Beispiel #1
0
        /// <summary>
        /// Create a new GSC File.
        /// </summary>
        public static void OpenGSC <T>() where T : AbstractFunction
        {
            string file  = Path.GetFileNameWithoutExtension(Options.GSC_Path);
            string dir   = Options.GSC_Path.Substring(0, Options.GSC_Path.IndexOf(file + ".gs"));
            string opath = dir + file + "_new.gsc";

            UtilLog.LogFile(Options.GSC_Path);
            new GSCFile <T>(Options.GSC_Path).Save(opath);
        }
Beispiel #2
0
        /// <summary>
        /// Create a new GSC File for each files in the directory.
        /// </summary>
        public static void OpenDirGSC <T>() where T : AbstractFunction
        {
            int           index = 1;
            List <string> dirs  = Directory.GetFiles(Options.GSC_Folder, "*.gs*",
                                                     Options.AllowSubDir ? SearchOption.AllDirectories : SearchOption.TopDirectoryOnly).ToList();

            dirs.RemoveAll(item => item.Contains("_new.gsc"));

            foreach (string path in dirs ?? Enumerable.Empty <string>())
            {
                if (Path.GetFileName(path).Contains("_new.gsc"))
                {
                    continue;
                }
                string file  = Path.GetFileNameWithoutExtension(path);
                string dir   = path.Substring(0, path.IndexOf(file + ".gs"));
                string opath = dir + file + "_new.gsc";

                UtilLog.LogFile(path, index, dirs.Count);
                new GSCFile <T>(path).Save(opath);
                index++;
            }
        }