public bool DetachExt(string extName) { if (RegMethod.DetachMpcBeExt(extName)) { _extColle.Remove(extName); MainVM.SaveToFile(this); return(true); } return(false); }
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); }
public bool AttachExt(string extName) { if (RegMethod.AttachMpcBeExt(extName)) { //Save ext. _extColle.Add(extName); MainVM.SaveToFile(this); } else { return(false); } return(true); }
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); }
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); }