C# Class TrackChanges.Command

Inheritance: IExternalCommand
Afficher le fichier Open project: pix3lot/Slackit

Méthodes publiques

Свойство Type Description
_start_state string>.Dictionary

Méthodes publiques

Méthode Description
ElementDescription ( Document doc, int element_id ) : string
ElementDescription ( Element e ) : string

Return a string describing the given element: .NET type name, category name, family and symbol name for a family instance, element id and element name.

Execute ( ExternalCommandData commandData, string &message, ElementSet elements ) : System.Result
GetElementState ( Element e ) : string

Return a string representing the given element state. This is the information you wish to track. It is up to you to ensure that all data you are interested in really is included in this snapshot. In this case, we ignore all elements that do not have a valid bounding box.

GetSnapshot ( IEnumerable a ) : string>.Dictionary

Return a dictionary mapping element id values to hash codes of the element state strings. This represents a snapshot of the current database state.

GetTrackedElements ( Document doc ) : IEnumerable

Retrieve all elements to track. It is up to you to decide which elements are of interest to you.

ReportDifferences ( Document doc, string>.Dictionary start_state, string>.Dictionary end_state ) : string

Compare the start and end states and report the differences found. In this implementation, we just store a hash code of the element state. If you choose to store the full string representation, you can use that for comparison, and then report exactly what changed and the original values as well.

Private Methods

Méthode Description
GetBytes ( string str ) : byte[]

Convert a string to a byte array.

Method Details

ElementDescription() public static méthode

public static ElementDescription ( Document doc, int element_id ) : string
doc Document
element_id int
Résultat string

ElementDescription() public static méthode

Return a string describing the given element: .NET type name, category name, family and symbol name for a family instance, element id and element name.
public static ElementDescription ( Element e ) : string
e Element
Résultat string

Execute() public méthode

public Execute ( ExternalCommandData commandData, string &message, ElementSet elements ) : System.Result
commandData ExternalCommandData
message string
elements ElementSet
Résultat System.Result

GetElementState() public static méthode

Return a string representing the given element state. This is the information you wish to track. It is up to you to ensure that all data you are interested in really is included in this snapshot. In this case, we ignore all elements that do not have a valid bounding box.
public static GetElementState ( Element e ) : string
e Element
Résultat string

GetSnapshot() public static méthode

Return a dictionary mapping element id values to hash codes of the element state strings. This represents a snapshot of the current database state.
public static GetSnapshot ( IEnumerable a ) : string>.Dictionary
a IEnumerable
Résultat string>.Dictionary

GetTrackedElements() public static méthode

Retrieve all elements to track. It is up to you to decide which elements are of interest to you.
public static GetTrackedElements ( Document doc ) : IEnumerable
doc Document
Résultat IEnumerable

ReportDifferences() public static méthode

Compare the start and end states and report the differences found. In this implementation, we just store a hash code of the element state. If you choose to store the full string representation, you can use that for comparison, and then report exactly what changed and the original values as well.
public static ReportDifferences ( Document doc, string>.Dictionary start_state, string>.Dictionary end_state ) : string
doc Document
start_state string>.Dictionary
end_state string>.Dictionary
Résultat string

Property Details

_start_state public_oe static_oe property

Current snapshot of database state. You could also store the entire element state strings here, not just their hash code, to report their complete original and modified values.
public static Dictionary _start_state
Résultat string>.Dictionary