public static string GetSMAPluginsFolder(
     this SMCollection collection,
     ISMAPlugin plugin = null)
 {
     return(plugin != null
 ? collection.GetFilePath(SMAConst.Paths.CollectionSMAFolder,
                          SMAConst.Paths.CollectionPluginsFolder,
                          plugin.Id.ToString("D"))
 : collection.GetFilePath(SMAConst.Paths.CollectionSMAFolder,
                          SMAConst.Paths.CollectionPluginsFolder));
 }
 public static string GetSMAElementsFolder(
     this SMCollection collection,
     int elementId = 0)
 {
     return(elementId == 0
 ? collection.GetFilePath(SMAConst.Paths.CollectionSMAFolder,
                          SMAConst.Paths.CollectionElementsFolder,
                          elementId.ToString())
 : collection.GetFilePath(SMAConst.Paths.CollectionSMAFolder,
                          SMAConst.Paths.CollectionElementsFolder));
 }
 public static string GetElementFilePath(
     this SMCollection collection,
     string filePath)
 {
     return(collection.GetFilePath(SMConst.Paths.ElementsFolder,
                                   filePath));
 }
 public static string GetRegistryFilePath(
     this SMCollection collection,
     string fileName)
 {
     return(collection.GetFilePath(SMConst.Paths.RegistryFolder,
                                   fileName));
 }
 public static string GetSMASystemFilePath(
     this SMCollection collection,
     string fileName)
 {
     return(collection.GetFilePath(SMAConst.Paths.CollectionSMAFolder,
                                   SMAConst.Paths.CollectionSystemFolder,
                                   fileName));
 }
        public static string MakeRelative(this SMCollection collection,
                                          string absolutePath)
        {
            string basePath = collection.GetFilePath();

            return(absolutePath.StartsWith(basePath)
        ? absolutePath.Substring(basePath.Length).TrimStart('\\', '/')
        : absolutePath);
        }
 public static string GetSMAPluginsFilePath(
     this SMCollection collection,
     ISMAPlugin plugin,
     string fileName)
 {
     return(collection.GetFilePath(SMAConst.Paths.CollectionSMAFolder,
                                   SMAConst.Paths.CollectionPluginsFolder,
                                   plugin.Id.ToString("D"),
                                   fileName));
 }
 public static string GetSMAElementsFilePath(
     this SMCollection collection,
     int elementId,
     string fileName)
 {
     return(collection.GetFilePath(SMAConst.Paths.CollectionSMAFolder,
                                   SMAConst.Paths.CollectionElementsFolder,
                                   elementId.ToString(),
                                   fileName));
 }
 public static string GetSMAFolder(
     this SMCollection collection)
 {
     return(collection.GetFilePath(SMAConst.Paths.CollectionSMAFolder));
 }
Пример #10
0
 public static string GetSMASystemFolder(
     this SMCollection collection)
 {
     return(collection.GetFilePath(SMAFileSystem.CollectionSMAFolder,
                                   SMAFileSystem.CollectionSystemFolder));
 }