C# Class META.ComponentLibraryManager

Exibir arquivo Open project: metamorph-inc/meta-core Class Usage Examples

Public Methods

Method Description
CreateComponentFolder ( IMgaProject project ) : String

Creates a unique folder, used for storing component resources, under the project's "components" folder. This operation DOES NOT assign the folder to any component; Consider using EnsureComponentDirectory(...) for this purpose.

EnsureAVMID ( ISIS.GME.Dsml.CyPhyML.Interfaces component ) : String

Given a component, ensures that is has an AVMID unique to its project. If it has an AVMID, and it is unique, it will not be changed. Otherwise, a new one will be assigned.

EnsureComponentAssemblyFolder ( ISIS.GME.Dsml.CyPhyML.Interfaces componentAssembly, string ProjectDirectory = null ) : String

Given a component assembly, ensures that the component assembly has a backend folder for storing resources. Creates a folder if necessary.

EnsureComponentFolder ( ISIS.GME.Dsml.CyPhyML.Interfaces component, string ProjectDirectory = null ) : String

Given a component, ensures that the component has a backend folder for storing resources. Ensures that the Component has an AVMID unique to the project. Creates a folder if necessary.

GetComponentFolderPath ( ISIS.GME.Dsml.CyPhyML.Interfaces component, PathConvention pathConvention = PathConvention.REL_TO_PROJ_ROOT, string ProjectDirectory = null ) : String

Given a component, ensures that the component has a backend folder for storing resources. Ensures that the Component has an AVMID unique to the project. Creates a folder if necessary.

GetProjectRootPath ( IMgaProject project ) : String

Get the absolute path to the root directory of a CyPhy project.

GetRandomComponentAssemblyDir ( ) : string
MakeRelativePath ( string fromPath, string toPath ) : string

Creates a relative path from one file or folder to another.

TryGetOriginalACMFilePath ( ISIS.GME.Dsml.CyPhyML.Interfaces component, string &path, PathConvention pathConvention = PathConvention.REL_TO_COMP_DIR, string ProjectDirectory = null ) : bool

Retrieves the path to the component's original ACM file, stored when it was imported. Note that ANY ACM file found will be flagged as a match, even if it has been updated for some reason.

TryGetResourcePath ( ISIS.GME.Dsml.CyPhyML.Interfaces domainModel, string &path, PathConvention pathConvention = PathConvention.REL_TO_COMP_DIR ) : bool

Given a DomainModel object, find the path to the file resource. This will traverse the UsesResource connection to a Resource object, then return that Resource object's path.

Private Methods

Method Description
PathContainsIllegalChar ( string path ) : bool

Method Details

CreateComponentFolder() public static method

Creates a unique folder, used for storing component resources, under the project's "components" folder. This operation DOES NOT assign the folder to any component; Consider using EnsureComponentDirectory(...) for this purpose.
public static CreateComponentFolder ( IMgaProject project ) : String
project IMgaProject
return String

EnsureAVMID() public static method

Given a component, ensures that is has an AVMID unique to its project. If it has an AVMID, and it is unique, it will not be changed. Otherwise, a new one will be assigned.
public static EnsureAVMID ( ISIS.GME.Dsml.CyPhyML.Interfaces component ) : String
component ISIS.GME.Dsml.CyPhyML.Interfaces
return String

EnsureComponentAssemblyFolder() public static method

Given a component assembly, ensures that the component assembly has a backend folder for storing resources. Creates a folder if necessary.
public static EnsureComponentAssemblyFolder ( ISIS.GME.Dsml.CyPhyML.Interfaces componentAssembly, string ProjectDirectory = null ) : String
componentAssembly ISIS.GME.Dsml.CyPhyML.Interfaces
ProjectDirectory string Directory in which the /designs/ folder resides. Defaults to project directory of
return String

EnsureComponentFolder() public static method

Given a component, ensures that the component has a backend folder for storing resources. Ensures that the Component has an AVMID unique to the project. Creates a folder if necessary.
public static EnsureComponentFolder ( ISIS.GME.Dsml.CyPhyML.Interfaces component, string ProjectDirectory = null ) : String
component ISIS.GME.Dsml.CyPhyML.Interfaces
ProjectDirectory string Directory in which the /components/ folder resides. Defaults to project directory of
return String

GetComponentFolderPath() public static method

Given a component, ensures that the component has a backend folder for storing resources. Ensures that the Component has an AVMID unique to the project. Creates a folder if necessary.
public static GetComponentFolderPath ( ISIS.GME.Dsml.CyPhyML.Interfaces component, PathConvention pathConvention = PathConvention.REL_TO_PROJ_ROOT, string ProjectDirectory = null ) : String
component ISIS.GME.Dsml.CyPhyML.Interfaces
pathConvention PathConvention The desired convention for the path.
ProjectDirectory string Directory in which component files reside. Defaults to project directory of
return String

GetProjectRootPath() public static method

Get the absolute path to the root directory of a CyPhy project.
public static GetProjectRootPath ( IMgaProject project ) : String
project IMgaProject
return String

GetRandomComponentAssemblyDir() public static method

public static GetRandomComponentAssemblyDir ( ) : string
return string

MakeRelativePath() public static method

Creates a relative path from one file or folder to another.
public static MakeRelativePath ( string fromPath, string toPath ) : string
fromPath string Contains the directory that defines the start of the relative path.
toPath string Contains the path that defines the endpoint of the relative path.
return string

TryGetOriginalACMFilePath() public static method

Retrieves the path to the component's original ACM file, stored when it was imported. Note that ANY ACM file found will be flagged as a match, even if it has been updated for some reason.
public static TryGetOriginalACMFilePath ( ISIS.GME.Dsml.CyPhyML.Interfaces component, string &path, PathConvention pathConvention = PathConvention.REL_TO_COMP_DIR, string ProjectDirectory = null ) : bool
component ISIS.GME.Dsml.CyPhyML.Interfaces
path string The path to the ACM file, according to the PathConvention
pathConvention PathConvention
ProjectDirectory string Directory in which component files reside. Defaults to project directory of
return bool

TryGetResourcePath() public static method

Given a DomainModel object, find the path to the file resource. This will traverse the UsesResource connection to a Resource object, then return that Resource object's path.
public static TryGetResourcePath ( ISIS.GME.Dsml.CyPhyML.Interfaces domainModel, string &path, PathConvention pathConvention = PathConvention.REL_TO_COMP_DIR ) : bool
domainModel ISIS.GME.Dsml.CyPhyML.Interfaces
path string The path to the resource, relative to the component's resource folder
pathConvention PathConvention
return bool