/\/\o\/\/ PowerShelled

This blog has moved to http://ThePowerShellGuy.com Greetings /\/\o\/\/
$AtomFeed = ("Atom.xml")
$PreviousItems = (" MSH TakeOwner working "," MSH Clipboard use workaround "," [MSH] keyboard status "," playing with MY-object from MSH "," MSH access NT provider "," Update-TypeData (Democracy to the types) "," MSH directory watcher with popup-balloon "," StartRDP script "," convert images in MSH "," Style Problems "," ")

Sunday, October 23, 2005


MSH Clipboard part 2 (of 3 ?)

ls, I started on my MSH ClipBoard object.

after my POC, it was a bit more work as I did expect at first.
because I needed threads,Hence I needed events to put the data back.
also I needed a ParameterizedThreadStart, to get input to the thread.

basicly I made 2 classes, one I call from MSH (ClipBoard), and 1 class STA that gets called by the Clipboard class on a STA thread.

if it has to return something, it will Raise a Ready Event that ClipBoard will Handle.

the function in the Clipboard-class will loop until the STA tread is ready, and then returns the result to MSH.

As for every function in the original Class, I had to make 2 functions in my wrapper, and I needed some EventHandlers there is a lot of boilerCode.
so I did not (yet ?) do All Methods of te original object.
but the rest is more of the same (.. and boring)
I did all the Contains except data, and the get / set as Text.

gr /\/\o\/\/

you can find the wrapper (MowClipboard.dll) here
After you load it you can do things like this :

MSH G:\Monad> [System.Reflection.Assembly]::LoadFile("g:\monad\MowClipBoard.dll"

GAC Version Location
--- ------- --------
False v2.0.50215 g:\monad\MowClipBoard.dll

MSH G:\Monad> $clip = new-object mow.clipboard
MSH G:\Monad> $clip.SetText("Hello ClipBoard")
MSH G:\Monad> $clip.ContainsText()
MSH G:\Monad> $clip.GetText()
Hello ClipBoard
MSH G:\Monad> $clip gm

TypeName: mow.ClipBoard

Name MemberType Definition
---- ---------- ----------
Clear Method System.Void Clear()
ContainsAudio Method System.Boolean ContainsAudio()
ContainsFileDropList Method System.Boolean ContainsFileDropList()
ContainsImage Method System.Boolean ContainsImage()
ContainsText Method System.Boolean ContainsText()
Equals Method System.Boolean Equals(Object obj)
GetHashCode Method System.Int32 GetHashCode()
GetText Method System.String GetText()
GetType Method System.Type GetType()
SetText Method System.Void SetText(String Text)
ToString Method System.String ToString()

MSH G:\Monad>

Comments: Post a Comment

Links to this post:

Create a Link

<< Home


October 2005   November 2005   December 2005   January 2006   February 2006   March 2006   April 2006   May 2006   June 2006   July 2006   August 2006   September 2006   October 2006   November 2006   December 2006  

$Links = ("PowerShell RC1 Docs"," PowerShell RC1 X86"," PowerShell RC1 X64"," Monad GettingStarted guide"," Monad Progamming Guide"," Monad SDK"," Monad videos on Channel 9"," MSH Community Workspace"," scripts.readify.net "," MonadSource"," www.reskit.net"," PowerShell Blog"," Under The Stairs"," computerperformance powershell Home"," proudlyserving"," MSH on wikipedia"," MSHWiki Channel 9"," Keith Hill's Blog"," Precision Computing"," PowerShell for fun"," MSH Memo (Japanese)"," monadblog")

find-blog -about "PowerShell","Monad" | out-Technorati.
find-blog -contains "","" | out-Technorati.
Web mow001.blogspot.com

This page is powered by Blogger. Isn't yours?