void OpenProj() { if (!PromptSave()) { return; } var ofd = new VistaOpenFileDialog(); ofd.Filter = "ConfuserEx Projects (*.crproj)|*.crproj|All Files (*.*)|*.*"; if ((ofd.ShowDialog(Application.Current.MainWindow) ?? false) && ofd.FileName != null) { string fileName = ofd.FileName; try { var xmlDoc = new XmlDocument(); xmlDoc.Load(fileName); var proj = new ConfuserProject(); proj.Load(xmlDoc); Project = new ProjectVM(proj); FileName = fileName; } catch { MessageBox.Show("Invalid project!", "ConfuserEx", MessageBoxButton.OK, MessageBoxImage.Error); } } }
void NewProj() { if (!PromptSave()) { return; } Project = new ProjectVM(new ConfuserProject()); FileName = "Unnamed.crproj"; }
private void NewProj() { if (!PromptSave()) { return; } Project = new ProjectVM(new ConfuserProject(), null); FileName = "Unnamed.mpxproj"; }
void NewProj() { if (!PromptSave()) { return; } Project = new ProjectVM(new ConfuserProject(), null); FileName = "未命名.crproj"; }
public ProjectRuleVM(ProjectVM parent, Rule rule) { this.parent = parent; this.rule = rule; ObservableCollection <ProjectSettingVM <Protection> > protections = Utils.Wrap(rule, setting => new ProjectSettingVM <Protection>(parent, setting)); protections.CollectionChanged += (sender, e) => parent.IsModified = true; Protections = protections; ParseExpression(); }
public ProjectModuleVM(ProjectVM parent, ProjectModule module) { this.parent = parent; this.module = module; ObservableCollection <ProjectRuleVM> rules = Utils.Wrap(module.Rules, rule => new ProjectRuleVM(parent, rule)); rules.CollectionChanged += (sender, e) => parent.IsModified = true; Rules = rules; if (module.Path != null) { SimpleName = System.IO.Path.GetFileName(module.Path); LoadAssemblyName(); } }
public ProjectSettingVM(ProjectVM parent, SettingItem <T> setting) { this.parent = parent; this.setting = setting; }