コード例 #1
0
ファイル: MainForm.cs プロジェクト: j-prox/blueprint41
        void NewFile(ModellerType type = ModellerType.Blueprint41)
        {
            DialogResult result = CheckForChangesAndSaveIfPossible();

            if (result != DialogResult.Cancel)
            {
                StoragePath = null;
                InitializeXmlModeller(type);
            }
        }
コード例 #2
0
ファイル: MainForm.cs プロジェクト: j-prox/blueprint41
        void InitializeXmlModeller(ModellerType type = ModellerType.Blueprint41)
        {
            InitializeModel(type);
            InitializeSubmodel();
            ReloadGraph();
            Recovery.Instance.Start(this, () => Console.WriteLine("Auto saved modeller"));

            SetModellerTypeMenuItemVisibility();
            EnableDisableButtons();
        }
コード例 #3
0
ファイル: MainForm.cs プロジェクト: j-prox/blueprint41
        void InitializeModel(ModellerType modellerType)
        {
            if ((object)Model != null)
            {
                Model.UnRegisterEvents();
            }

            Model = new Model();

            try
            {
                if (File.Exists(StoragePath))
                {
                    Model = new Model(StoragePath);
                }
            }
            catch (XmlException)
            {
                MessageBox.Show($"The path {StoragePath} is an invalid xml file", "Invalid Xml File", MessageBoxButtons.OK, MessageBoxIcon.Error);
                RegistryHandler.LastOpenedFile = string.Empty;

                if (Model == null)
                {
                    Model = new Model();
                }
            }

            Model.Type         = Model.Type ?? modellerType.ToString();
            Model.HasChanges   = false;
            Model.BeforeReBind = ClearEvents;
            Model.AfterReBind  = AddEvents;

            Model.ShowRelationshipLabels     = showLabels;
            Model.ShowInheritedRelationships = showInherited;

            string editorName = Model.ModellerType == ModellerType.Blueprint41 ? B41_EDITOR : NEO4J_EDITOR;

            this.Text = $"{FORMNAME} - ({editorName})";
            graphEditor.ModellerType = Model.ModellerType;

            //CheckGuidDiscrepancies();
        }