コード例 #1
0
 public static string GetRegistryFilePath(
     this SMCollection collection,
     string fileName)
 {
     return(collection.GetFilePath(SMConst.Paths.RegistryFolder,
                                   fileName));
 }
コード例 #2
0
 public static string GetElementFilePath(
     this SMCollection collection,
     string filePath)
 {
     return(collection.GetFilePath(SMConst.Paths.ElementsFolder,
                                   filePath));
 }
コード例 #3
0
 public static string GetFilePath(
     this   SMCollection collection,
     params string[]     paths)
 {
     return(Path.Combine(collection.Path,
                         collection.Name,
                         Path.Combine(paths)));
 }
コード例 #4
0
 public static string GetSMAConfigsSubFolder(
     this SMCollection collection,
     string subFolder)
 {
     return(collection.CombinePath(SMAFileSystem.CollectionSMAFolder,
                                   SMAFileSystem.ConfigsFolder,
                                   subFolder));
 }
コード例 #5
0
 public static string GetSMASystemFilePath(
     this SMCollection collection,
     string fileName)
 {
     return(collection.GetFilePath(SMAConst.Paths.CollectionSMAFolder,
                                   SMAConst.Paths.CollectionSystemFolder,
                                   fileName));
 }
コード例 #6
0
        public static string MakeRelative(this SMCollection collection,
                                          string absolutePath)
        {
            string basePath = collection.GetFilePath();

            return(absolutePath.StartsWith(basePath)
        ? absolutePath.Substring(basePath.Length).TrimStart('\\', '/')
        : absolutePath);
        }
コード例 #7
0
 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));
 }
コード例 #8
0
 public static string GetSMAElementsFilePath(
     this SMCollection collection,
     int elementId,
     string fileName)
 {
     return(collection.GetFilePath(SMAConst.Paths.CollectionSMAFolder,
                                   SMAConst.Paths.CollectionElementsFolder,
                                   elementId.ToString(),
                                   fileName));
 }
コード例 #9
0
 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));
 }
コード例 #10
0
 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));
 }
コード例 #11
0
 public static string GetSMAElementsFolder(
     this SMCollection collection,
     int elementId = 0)
 {
     return(elementId == 0
 ? collection.CombinePath(SMAFileSystem.CollectionSMAFolder,
                          SMAFileSystem.CollectionElementsFolder,
                          elementId.ToString())
 : collection.CombinePath(SMAFileSystem.CollectionSMAFolder,
                          SMAFileSystem.CollectionElementsFolder));
 }
コード例 #12
0
 public static string GetSMAFolder(
     this SMCollection collection)
 {
     return(collection.GetFilePath(SMAConst.Paths.CollectionSMAFolder));
 }
コード例 #13
0
 public static string GetKnoFilePath(this SMCollection collection)
 {
     return(Path.Combine(collection.Path,
                         collection.Name + ".Kno"));
 }
コード例 #14
0
 public static string GetSMASystemFolder(
     this SMCollection collection)
 {
     return(collection.GetFilePath(SMAFileSystem.CollectionSMAFolder,
                                   SMAFileSystem.CollectionSystemFolder));
 }
コード例 #15
0
 public static string GetRootDirPath(this SMCollection collection)
 {
     return(Path.Combine(collection.Path, collection.Name));
 }