PowerShell In GUI Blog

PowerShell GUI Box Just In A Few Clicks

Archive for March 2011

ObjectBrowser has migrated to Set-StrictMode successfully

leave a comment »

Today, as I sincerely hope, I fixed the last but major bug stemmed from moving to the use of the Set-StrictMode statement. This bug prevented ObjectBrowser GUI from displaying properties, events and fields of classes. A major one, need to admit.

As a result, list of signatures of methods became a simple list of method names, so that all clas members now can be sorted by name, member type (i.e. property, method, etc), and a return value or property, saying about methods and fields.

Also, types of event handlers are shown after this fix.

To conclude, you might now instead of typing something like

[System.Windows.Forms.Form]$frm = 
    New-Object System.Windows.Forms.Form;
#never run it by Ctrl+F7 
#and never expand 
#the $frm variable in the Variables frame

simply navigate to the System.Windows.Forms.dll assembly, through the System.Windows.Forms namespace, after that click on the Form class and get the full list of its members.

Written by Alexander Petrovskiy

March 30, 2011 at 6:55 pm

Which Icons Are Shipped With Object Browser?

leave a comment »

Actually, what is the easiest way to display icons? Create a control like ListView? Maybe. Let’s create a handful of windows, just to observe how short the code might be.

First, import both modules, SuiteCore and ObjectBrowser (here and thereafter the PSDevStudioLite modules set is in use).

After that you are able to use the function set shipped with the package. The following simple code creates windows, which in turn demostrate icons.

cls
function createWindows
{
    for($private:i = 0; $private:i -lt $imagesList.Count; $private:i++)
    {
        $tw2 = New-SEToolWindow -Control (([System.Windows.Forms.ListBox]$lb = New-Object System.Windows.Forms.ListBox) | %{$lb;}) `
            -TitleBarText ("aaa" + $private:i) `
            -WindowName ("aaaaa" + $private:i) `
            -Image $imagesList[$imagesList.Keys[$private:i]] `
            -Visible $false -State TabbedDocument;
        Write-Host $private:i $imagesList.Keys[$private:i]
        $se.ToolWindows[("aaaaa" + $private:i)].Visible = $true;
    }
}

createWindows;

In the GUI you might easily see all of them by clicking a triangle, allowing you to make a list of all open documents:

To clean up the document list is also simply, even somewhat simpler that to fill up:

function removeWindows
{
for($private:i = 0; $private:i -lt $imagesList.Count; $private:i++)
{
Remove-SEToolWindow -WindowName ("aaaaa" + $private:i);
}
}

removeWindows;

 

Requirements: PSDevStudioLite.SuiteCore 1.0.0.4 Beta and higher, PSDevStudioLite.ObjetBrowser 1.0.0.4 Beta ang higher.

http://www.box.net/shared/ot56ct7ngl

Note: all above are never be supported by quest, wasn’t and won’t be.

OB 1.0.0.3

leave a comment »

Object Browser 1.0.0.3 is uploaded to the link http://www.box.net/shared/ot56ct7ngl

This version comprises of two small improvements. The first one is a moving to be used in Strict mode. The second, and resulting the first one, is an improvement in showing private members.

Written by Alexander Petrovskiy

March 21, 2011 at 7:41 pm

OB 1.0.0.2

leave a comment »

As I languidly tested what was released recently as ObjectBrowser 1.0.0.1 July, 12th 2010, I remembered a couple of bugx I always wanted to fix. Today’s 1.0.0.2 shipped with

– search by name

– PleaseWait window

both fixed. As usual, the direct link is the same: ObjectBrowser

Written by Alexander Petrovskiy

March 18, 2011 at 7:49 pm

Direct links also came

leave a comment »

To make downloading as simply as possible, I also give you, who need samples that can be opened in your Powershell IDE, the direct links to the files published since the beginning of this blog.

HowToDealWithAListViewControl.zip described here How to deal with a ListView control

HowToDealWithRoutedEventParameterInWPK.zip illustrating How to deal with -RoutedEvent parameter in WPK

QADinGUI.zip relating to both Using Quest cmdlets from .NET. The complete walkthrough and Using Quest cmdlets from .NET. The complete walkthrough. Part 2

HowToDealWithAComboBoxControl.zip referring to How to deal with a ComboBox control

ObjectBrowser_20100712.zip requested here I’m interested in seeing an Object Explorer…

Hope, that’s all of the mentioned in this blog, otherwise don’t hesitate to write comments to this post asking to add links to something forgotten.

Written by Alexander Petrovskiy

March 15, 2011 at 6:47 pm

Posted in Powershell

Tagged with

For Those Who Wanted to Download Code Samples

leave a comment »

Recently, I’ve been requested to put out a code sample. This blog is meant as dead for almost a year, but I visit its dashboard on a  monthly basis just by a habit.

To fulfill the wish of the requester, I visited http://www.box.net since I almost forgot how to use a file box that is the only way I knew last year to share files on a WordPress blog. To my utter amusement, this blog counting four thousand visits and the most of them are counted after I wrote the last post, this blog has been read but not used as a download place.

The box statistics shows that files weren’t downloaded by anybody except me:

Actually, I’m surprised if people copy/paste code instead of using code samples. Meanwhile, the download is simple, even despite being tricked on the first use, and the steps you need perform as follows:

1. Navigate your mouse’s cursor to the rigth until you find the gray box:

2. Using the triangle arrows at the top and/or the bottom of the box, you may opt the sample you are interested in.

3. Click on the sample chosen. The message appears as shown below:

4. As I may suppose your choise is the Download button. However, the first try is not always successful:

At the same time, the standard Windows File Save dialog appears. Choose the path you want to save a sample and save the sample. If your download was successful, you’ll see the positively-grey message like this:

Otherwise, the message ‘Now downloading…’ is shown endlessly. If so, just close it by clicking into cross at the upper-right corner to close the message and do the same sequence of actions. The second time always finishes with the sample on the your hard drive.

All the steps described above are proceeded in the Firefox 4.0 Beta 12 instance that is set by default and no doubts that you may download samples instead of copying the code from pages.

Written by Alexander Petrovskiy

March 12, 2011 at 7:44 am

Posted in WordPress

Tagged with