Beispiel #1
0
 public bool DetachExt(string extName)
 {
     if (RegMethod.DetachMpcBeExt(extName))
     {
         _extColle.Remove(extName);
         MainVM.SaveToFile(this);
         return(true);
     }
     return(false);
 }
Beispiel #2
0
        public static void SaveToFile(MainVM vm)
        {
            string content  = "";
            string filePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + AppEnum.SAVE_EXT_FILE_NAME;

            foreach (string ext in vm._extColle)
            {
                content += ext + Environment.NewLine;
            }
            File.WriteAllText(filePath, content);
        }
Beispiel #3
0
 public bool AttachExt(string extName)
 {
     if (RegMethod.AttachMpcBeExt(extName))
     {
         //Save ext.
         _extColle.Add(extName);
         MainVM.SaveToFile(this);
     }
     else
     {
         return(false);
     }
     return(true);
 }
Beispiel #4
0
        public static MainVM LoadSaveFile()
        {
            MainVM ret      = new MainVM();
            string filePath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\" + AppEnum.SAVE_EXT_FILE_NAME;

            if (!File.Exists(filePath))
            {
                return(ret);
            }
            foreach (string ext in File.ReadAllLines(filePath))
            {
                ret._extColle.Add(ext);
            }
            return(ret);
        }
Beispiel #5
0
        public bool AttachExt(List <string> extList)
        {
            foreach (string extName in extList)
            {
                if (RegMethod.AttachMpcBeExt(extName))
                {
                    //Save ext.
                    _extColle.Add(extName);
                }
            }

            MainVM.SaveToFile(this);

            return(true);
        }