Skip to main content
Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/DropUtils.cs (line 17) Utility class for drag and drop actions on a ModelCenter GUI.

Members

Private static functions

Function GetObjectForPathInternal

When as item is dropped the drop text could be a full name of a variable, group, assembly, or component. This searches the model to determine what it is and returns it as an object of the correct type. Parameters:
  • path: Text passed to the dropped control.
  • searchIn: ModelCenter object to begin searching in.
Returns: An object of the correct type as found in the ModelCenter model, or null if nothing was found. Parameters:
  • string path
  • object searchIn
Return type: object

Function GetAllVariablesInternal

Get all variables corresponding to the specified object or objects based on the specified path of drop text, which corresponds to a path in a ModelCenter model. Parameters:
  • mcObject: ModelCenter object.
  • path: Path into the model.
Returns: List of the variables. Parameters:
  • object mcObject
  • string path
Return type: List< PHXVariable >

Public static functions

Function GetObjectForPath

Given a single path of drop text returns the object in ModelCenter that path represents. Parameters:
  • path: The dropped path to the object.
  • modelCenter: ModelCenter instance to search.
Returns: ModelCenter object being dropped. Parameters:
  • string path
  • IModelCenter modelCenter
Return type: object

Function GetVariablesForPath

Get all variables associated with a particular path Parameters:
  • path: The path to search for
  • modelCenter: The ModelCenter API to query
Returns: The list of associated variables, which may be empty if no variables are found. Parameters:
  • string path
  • IModelCenter modelCenter
Return type: IList< PHXVariable >

Function GetVariablesForPaths

Get the variables associated with a set of paths. Parameters:
  • paths: The paths.
  • metaDataProvider: The metadata provider.
  • validate: Whether to validate variable names.
Returns: The list of variables. There is no guarantee that there aren’t any duplicates if the same item is specified twice. Parameters:
  • IEnumerable< string > paths
  • IVariableMetaDataProvider metaDataProvider
  • bool validate
Return type: IList< PHXVariable >

Function GetVariablesForDropText

Parse text dropped into a control or form that represents a list of variables or ModelCenter objects. Return all variables found. Parameters:
  • dropText: The drop text.
  • metaDataProvider: The variable metadata provider.
  • validate: Whether to validate names.
Returns: The list of variables found. Parameters:
  • string dropText
  • IVariableMetaDataProvider metaDataProvider
  • bool validate
Return type: IList< PHXVariable >

Function HasVariableDropText

Determine if the text being dragged is of a valid format. Parameters:
  • e: The event args.
Returns: True if yes, false if no. Parameters:
  • DragEventArgs e
Return type: bool

Function GetVariablesForDropText

Parse text dropped into a control or form that represents a list of variables or ModelCenter objects. Return all variables found. Parameters:
  • e: The drag-drop event args.
  • metaDataProvider: The variable metadata provider.
  • validate: Whether to validate names.
Returns: The list of variables found. Parameters:
  • DragEventArgs e
  • IVariableMetaDataProvider metaDataProvider
  • bool validate
Return type: IList< PHXVariable >