C# Class RvtSamples.Application

Main external application class. A generic menu generator application. Read a text file and add entries to the Revit menu. Any number and location of entries is supported.
Inheritance: IExternalApplication
Exibir arquivo Open project: AMEE/revit

Public Methods

Method Description
AddSample ( string lines, int n, int &i ) : void

Add a new command to the corresponding pulldown button.

ErrorMsg ( string msg ) : void

Display error message

OnShutdown ( UIControlledApplication application ) : Autodesk.Revit.UI.Result

Implement this method to implement the external application which should be called when Revit is about to exit,Any documents must have been closed before this method is called.

OnStartup ( UIControlledApplication application ) : Autodesk.Revit.UI.Result

Implement this method to implement the external application which should be called when Revit starts before a file or default template is actually loaded.

Private Methods

Method Description
AddCustomizedPulldownMenus ( ) : void

Add samples of categories not in default categories

AddSampleToPulldownMenu ( PulldownButton pullDownButton, SampleItem item ) : void

Add sample item to pulldown menu

AddSamplesToDefaultPulldownMenus ( ) : void

Add samples of categories in default categories

AddSamplesToStackedButtons ( IList buttons ) : void

Add samples to corresponding pulldown button

GetDisplayNameByEnumName ( string enumName ) : string

Get a button's display name by its enum name

GetEnumNameByDisplayName ( string name ) : string

Get a button's enum name by its display name

GetFilepath ( string &filename ) : bool

Get the input file path. Search and return the full path for the given file in the current exe directory or one or two directory levels higher.

ReadAllLinesWithInclude ( string filename ) : string[]

Read file contents, including contents of files included in the current file

RemoveComments ( string lines ) : string[]

Remove all comments and empty lines from a given array of lines. Comments are delimited by '#' to the end of the line.

SortByDisplayName ( SampleItem item1, SampleItem item2 ) : int

Comparer to sort sample items by their display name

SortSampleItemsInOneCategory ( SortedList menus ) : void

Sort samples in one category by the sample items' display name

Method Details

AddSample() public method

Add a new command to the corresponding pulldown button.
public AddSample ( string lines, int n, int &i ) : void
lines string Array of lines defining sample's category, display name, description, large image, image, assembly and classname
n int Total number of lines in array
i int Current index in array
return void

ErrorMsg() public method

Display error message
public ErrorMsg ( string msg ) : void
msg string Message to display
return void

OnShutdown() public method

Implement this method to implement the external application which should be called when Revit is about to exit,Any documents must have been closed before this method is called.
public OnShutdown ( UIControlledApplication application ) : Autodesk.Revit.UI.Result
application UIControlledApplication An object that is passed to the external application /// which contains the controlled application.
return Autodesk.Revit.UI.Result

OnStartup() public method

Implement this method to implement the external application which should be called when Revit starts before a file or default template is actually loaded.
public OnStartup ( UIControlledApplication application ) : Autodesk.Revit.UI.Result
application UIControlledApplication An object that is passed to the external application /// which contains the controlled application.
return Autodesk.Revit.UI.Result