예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        void NewProj()
        {
            if (!PromptSave())
            {
                return;
            }

            Project  = new ProjectVM(new ConfuserProject());
            FileName = "Unnamed.crproj";
        }
예제 #3
0
        private void NewProj()
        {
            if (!PromptSave())
            {
                return;
            }

            Project  = new ProjectVM(new ConfuserProject(), null);
            FileName = "Unnamed.mpxproj";
        }
예제 #4
0
        void NewProj()
        {
            if (!PromptSave())
            {
                return;
            }

            Project  = new ProjectVM(new ConfuserProject(), null);
            FileName = "未命名.crproj";
        }
예제 #5
0
        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();
        }
예제 #6
0
        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();
            }
        }
예제 #7
0
 public ProjectSettingVM(ProjectVM parent, SettingItem <T> setting)
 {
     this.parent  = parent;
     this.setting = setting;
 }