C# Класс META.ComponentLibraryManager

Показать файл Открыть проект Примеры использования класса

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

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

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

Метод Описание
PathContainsIllegalChar ( string path ) : bool

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

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

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

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

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

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

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

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

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

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

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

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

Get the absolute path to the root directory of a CyPhy project.
public static GetProjectRootPath ( IMgaProject project ) : String
project IMgaProject
Результат String

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

public static GetRandomComponentAssemblyDir ( ) : string
Результат string

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

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

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

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

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

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