Skip to main content
Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/ModelCenterFavoritesProvider.cs (line 116) Common favorites provider that saves and loads ModelCenter Plug-In XML.
Inherits from:
  • IFavoritesProvider

Members

Private attributes

Variable _favorites

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/ModelCenterFavoritesProvider.cs (line 119)
Type: Dictionary< string, string >

Variable _plugIn

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/ModelCenterFavoritesProvider.cs (line 120)
Type: IStringSerializer

Variable _modelCenter

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/ModelCenterFavoritesProvider.cs (line 121)
Type: IModelCenter

Variable _logger

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/ModelCenterFavoritesProvider.cs (line 122)
Type: IPHXLogger

Variable _type

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/ModelCenterFavoritesProvider.cs (line 123)
Type: string

Private static attributes

Variable XML_FAVORITES

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/ModelCenterFavoritesProvider.cs (line 124)
Type: const string

Variable XML_FAVORITE

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/ModelCenterFavoritesProvider.cs (line 125)
Type: const string

Variable XML_FAVORITES_TYPE_ATT

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/ModelCenterFavoritesProvider.cs (line 126)
Type: const string

Variable XML_FAVORITES_DESCRIPTION_ATT

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/ModelCenterFavoritesProvider.cs (line 127)
Type: const string

Properties

Property FavoritesNames

Definition: LIBS/DotNetUtils/Phoenix.ModelCenter.PlugIn/ModelCenterFavoritesProvider.cs (line 205)
List of available favorites. Return type: IEnumerable< string >

Public functions

Function ModelCenterFavoritesProvider

Constructor for ITradeStudyPlugIn. Parameters:
  • modelCenter: The ModelCenter object the favorites will save and load from.
  • plugIn: The trade study plug-in to serialize into favorites.
  • logger: Logger to record warnings that occur during loading and saving.
  • type: Favorites type to user for serialization.
Parameters:
  • IModelCenter modelCenter
  • ITradeStudyPlugIn plugIn
  • IPHXLogger logger
  • string type
Return type:

Function ModelCenterFavoritesProvider

Constructor for IComponentPlugIn. Parameters:
  • modelCenter: The ModelCenter object the favorites will save and load from.
  • plugIn: The trade study plug-in to serialize into favorites.
  • logger: Logger to record warnings that occur during loading and saving.
  • type: Favorites type to user for serialization.
Parameters:
  • IModelCenter modelCenter
  • IComponentPlugIn plugIn
  • IPHXLogger logger
  • string type
Return type:

Function ModelCenterFavoritesProvider

Constructor for IDotNetPlugIn. Parameters:
  • plugin: The IDotNetPlugIn to save/load from.
  • type: Favorites type to user for serialization.
Parameters: Return type:

Function ModelCenterFavoritesProvider

Constructor for IDotNetPlugIn. Parameters:
  • modelCenter: The ModelCenter object the favorites will save and load from.
  • plugIn: The object to serialize into favorites.
  • logger: Logger to record warnings that occur during loading and saving.
  • type: Favorites type to user for serialization.
Parameters: Return type:

Function AddFavorite

Add the favorite to the list of available favorites. Parameters:
  • name: Name of favorite to add.
Parameters:
  • string name
Return type: void

Function AddOrReplaceFavorite

Add the favorite to the list of available favorites. If a favorite with the given name already exists, it will be replaced. Parameters:
  • name: The name of the favorite to replace.
Parameters:
  • string name
Return type: void

Function RemoveFavorite

Remove the favorite from the list of available favorites. Parameters:
  • name: Favorite to remove.
Parameters:
  • string name
Return type: void

Function ApplyFavorite

Apply the favorites setup string to the Plug-In. Parameters:
  • name: Name of the favorite to apply.
Exceptions:
  • InvalidOperationException: Thrown when the given name is not valid.
Parameters:
  • string name
Return type: void

Function LoadFavorites

Loads favorites from the saved ModelCenter model. Return type: void

Function LoadFavorites

Loads the favorites of the given type. Useful when loading favorites for one plug-in that may be saved under different types. Parameters:
  • favoritesType: Favorites type name.
  • legacyLocation: Where favorite was imported from.
Parameters:
  • string favoritesType
  • string legacyLocation = null
Return type: void

Function SaveFavorites

Saves favorites to the saved ModelCenter model. Return type: void