C# Класс TrackChanges.Command

Наследование: IExternalCommand
Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
_start_state string>.Dictionary

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

Метод Описание
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.

Приватные методы

Метод Описание
GetBytes ( string str ) : byte[]

Convert a string to a byte array.

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

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

public static ElementDescription ( Document doc, int element_id ) : string
doc Document
element_id int
Результат string

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

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
Результат string

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

public Execute ( ExternalCommandData commandData, string &message, ElementSet elements ) : System.Result
commandData ExternalCommandData
message string
elements ElementSet
Результат System.Result

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

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
Результат string

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

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
Результат string>.Dictionary

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

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
Результат IEnumerable

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

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
Результат string

Описание свойств

_start_state публичное статическое свойство

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
Результат string>.Dictionary