C# Класс RevitLookup.Snoop.Utils

Utility functions to use in the Snoop dialog mechanism.
Показать файл Открыть проект

Открытые методы

Метод Описание
AppendThePropertyObject ( ArrayList data, String propertyName, Object value ) : void
BrowseReflection ( Object obj ) : void

Given an Object, allow the user to browse its properties based on Reflection only.

CopyToClipboard ( ListView lv ) : void

CopyToClipboard ( System.Windows.Forms.ListViewItem lvItem, System.Boolean multipleItems ) : void

DataItemSelected ( ListView lvCur ) : void

A Snoop.Data item was selected in the ListView. Call its DrillDown() function to get more detailed info about it.

Display ( ListView lvCur, Snoop snoopCollector ) : void

Given a ListView to display the data in, clear it out and add all the data that has been collected. For things that have a DrillDown, change the font to Bold so the user knows they can select it. For things that are a Separator, change the background color.

GetMaximumColumnWidths ( ListView lv ) : System.Int32[]

GetPrintDocumentName ( TreeNode node ) : String

GetRootNode ( TreeNode node ) : TreeNode

HorizontalAlignmentToStringAligment ( HorizontalAlignment ha ) : StringAlignment

IsKeyValuePair ( object o ) : bool

Check if the object type is KeyValuePair.

IsSupportedType ( Object value ) : bool

Check if the given instance is the basic types we supported.

ObjToLabelStr ( System obj ) : string

Same as above, but this is used when we are already grouping the objects by Type in a TreeCtrl. Including the Type name would be redundant.

ObjToTypeStr ( System obj ) : string

Format a type string to represent a given object. If it is an Element, we try to get some extra information that may be useful, such as the Name and the ElementId. If it isn't an Element then just print out

Print ( String title, ListView lv, System e, Int32 maxFieldWidth, Int32 maxValueWidth, Int32 currentItem ) : Int32

PrintMenuItemClick ( System.Windows.Forms.PrintDialog dlg ) : void

PrintMenuItemClick ( System.Windows.Forms.PrintDialog dlg, TreeView tv ) : void

PrintPreviewMenuItemClick ( System.Windows.Forms.PrintPreviewDialog dlg, ListView lv ) : void

PrintPreviewMenuItemClick ( System.Windows.Forms.PrintPreviewDialog dlg, TreeView tv ) : void

StreamWithReflection ( ArrayList data, Type type, Object instance ) : void

Stream the property with reflection.

UpdatePrintSettings ( ListView lv, Int32 &widthArray ) : void

UpdatePrintSettings ( System.Drawing.Printing.PrintDocument doc, TreeView tv, ListView lv, Int32 &widthArray ) : void

Utils ( ) : System

Описание методов

AppendThePropertyObject() публичный статический Метод

public static AppendThePropertyObject ( ArrayList data, String propertyName, Object value ) : void
data System.Collections.ArrayList
propertyName String
value Object
Результат void

BrowseReflection() публичный статический Метод

Given an Object, allow the user to browse its properties based on Reflection only.
public static BrowseReflection ( Object obj ) : void
obj Object Object to browse
Результат void

CopyToClipboard() публичный статический Метод

public static CopyToClipboard ( ListView lv ) : void
lv System.Windows.Forms.ListView
Результат void

CopyToClipboard() публичный статический Метод

public static CopyToClipboard ( System.Windows.Forms.ListViewItem lvItem, System.Boolean multipleItems ) : void
lvItem System.Windows.Forms.ListViewItem
multipleItems System.Boolean
Результат void

DataItemSelected() публичный статический Метод

A Snoop.Data item was selected in the ListView. Call its DrillDown() function to get more detailed info about it.
public static DataItemSelected ( ListView lvCur ) : void
lvCur System.Windows.Forms.ListView The ListView control in question
Результат void

Display() публичный статический Метод

Given a ListView to display the data in, clear it out and add all the data that has been collected. For things that have a DrillDown, change the font to Bold so the user knows they can select it. For things that are a Separator, change the background color.
public static Display ( ListView lvCur, Snoop snoopCollector ) : void
lvCur System.Windows.Forms.ListView The ListView UI control to draw into
snoopCollector Snoop The collected data about an object
Результат void

GetMaximumColumnWidths() публичный статический Метод

public static GetMaximumColumnWidths ( ListView lv ) : System.Int32[]
lv System.Windows.Forms.ListView
Результат System.Int32[]

GetPrintDocumentName() публичный статический Метод

public static GetPrintDocumentName ( TreeNode node ) : String
node System.Windows.Forms.TreeNode
Результат String

GetRootNode() публичный статический Метод

public static GetRootNode ( TreeNode node ) : TreeNode
node System.Windows.Forms.TreeNode
Результат System.Windows.Forms.TreeNode

HorizontalAlignmentToStringAligment() публичный статический Метод

public static HorizontalAlignmentToStringAligment ( HorizontalAlignment ha ) : StringAlignment
ha HorizontalAlignment
Результат StringAlignment

IsKeyValuePair() публичный статический Метод

Check if the object type is KeyValuePair.
public static IsKeyValuePair ( object o ) : bool
o object
Результат bool

IsSupportedType() публичный статический Метод

Check if the given instance is the basic types we supported.
public static IsSupportedType ( Object value ) : bool
value Object
Результат bool

ObjToLabelStr() публичный статический Метод

Same as above, but this is used when we are already grouping the objects by Type in a TreeCtrl. Including the Type name would be redundant.
public static ObjToLabelStr ( System obj ) : string
obj System Object to label
Результат string

ObjToTypeStr() публичный статический Метод

Format a type string to represent a given object. If it is an Element, we try to get some extra information that may be useful, such as the Name and the ElementId. If it isn't an Element then just print out
public static ObjToTypeStr ( System obj ) : string
obj System Object to label
Результат string

Print() публичный статический Метод

public static Print ( String title, ListView lv, System e, Int32 maxFieldWidth, Int32 maxValueWidth, Int32 currentItem ) : Int32
title String
lv System.Windows.Forms.ListView
e System
maxFieldWidth System.Int32
maxValueWidth System.Int32
currentItem System.Int32
Результат System.Int32

PrintMenuItemClick() публичный статический Метод

public static PrintMenuItemClick ( System.Windows.Forms.PrintDialog dlg ) : void
dlg System.Windows.Forms.PrintDialog
Результат void

PrintMenuItemClick() публичный статический Метод

public static PrintMenuItemClick ( System.Windows.Forms.PrintDialog dlg, TreeView tv ) : void
dlg System.Windows.Forms.PrintDialog
tv System.Windows.Forms.TreeView
Результат void

PrintPreviewMenuItemClick() публичный статический Метод

public static PrintPreviewMenuItemClick ( System.Windows.Forms.PrintPreviewDialog dlg, ListView lv ) : void
dlg System.Windows.Forms.PrintPreviewDialog
lv System.Windows.Forms.ListView
Результат void

PrintPreviewMenuItemClick() публичный статический Метод

public static PrintPreviewMenuItemClick ( System.Windows.Forms.PrintPreviewDialog dlg, TreeView tv ) : void
dlg System.Windows.Forms.PrintPreviewDialog
tv System.Windows.Forms.TreeView
Результат void

StreamWithReflection() публичный статический Метод

Stream the property with reflection.
public static StreamWithReflection ( ArrayList data, Type type, Object instance ) : void
data System.Collections.ArrayList
type System.Type
instance Object
Результат void

UpdatePrintSettings() публичный статический Метод

public static UpdatePrintSettings ( ListView lv, Int32 &widthArray ) : void
lv System.Windows.Forms.ListView
widthArray System.Int32
Результат void

UpdatePrintSettings() публичный статический Метод

public static UpdatePrintSettings ( System.Drawing.Printing.PrintDocument doc, TreeView tv, ListView lv, Int32 &widthArray ) : void
doc System.Drawing.Printing.PrintDocument
tv System.Windows.Forms.TreeView
lv System.Windows.Forms.ListView
widthArray System.Int32
Результат void

Utils() публичный Метод

public Utils ( ) : System
Результат System