Beispiel #1
0
        private void SaveProjectAs_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var m = __any_binding_error();

            if (m != null)
            {
                HandyControl.Controls.MessageBox.Show(this, $"At least one data binding error was found in <{m.FriendlyName}>.", "Error Message", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            try
            {
                System.Windows.Forms.SaveFileDialog save = new System.Windows.Forms.SaveFileDialog();
                save.Filter       = "JavaScript Object Notation(*.json)|*.json";
                save.AddExtension = true;
                save.DefaultExt   = "json";
                if (save.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                {
                    __docking_documents_layout = __save_documents_docking_layout(_ToolboxContainer);
                    var floatingLayout = __save_documents_floating_layout();

                    MainDataModel.SAVE_TO_JSON(__target_manager_data_model, __cabinets_navigation_data_model, __docking_documents_layout, floatingLayout, save.FileName);
                    __main_wnd_data_model.ProjectPath = save.FileName;
                    __main_wnd_data_model.IsDirty     = false;
                }
            }
            catch (Exception ex)
            {
                HandyControl.Controls.MessageBox.Show(this, $"At least one unexpected error occured while saving the project.\n{ex.Message}", "Error Message", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }
Beispiel #2
0
        private void SaveProject_Executed(object sender, ExecutedRoutedEventArgs e)
        {
            var m = __any_binding_error();

            if (m != null)
            {
                HandyControl.Controls.MessageBox.Show(this, $"At least one data binding error was found in <{m.FriendlyName}>.", "Error Message", MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            try
            {
                __docking_documents_layout = __save_documents_docking_layout(_ToolboxContainer);
                var floatingLayout = __save_documents_floating_layout();

                MainDataModel.SAVE_TO_JSON(__target_manager_data_model, __cabinets_navigation_data_model, __docking_documents_layout, floatingLayout, __main_wnd_data_model.ProjectPath);
                __main_wnd_data_model.IsDirty = false;
            }
            catch (Exception ex)
            {
                HandyControl.Controls.MessageBox.Show(this, $"At least one unexpected error occured while saving the project.\n{ex.Message}", "Error Message", MessageBoxButton.OK, MessageBoxImage.Error);
            }
        }