Пример #1
0
        private void MenuSaveCommand_Execute(object param)
        {
            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Filter           = "AlarmWorkflow JSON file (*.json)|*.json";
            saveFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            if (saveFileDialog.ShowDialog() == true)
            {
                OperationSerializer.Serialize(CreateOperation(), saveFileDialog.FileName);
            }
        }
Пример #2
0
        private void MenuOpenCommand_Execute(object param)
        {
            OpenFileDialog openFileDialog = new OpenFileDialog();

            openFileDialog.Filter           = "AlarmWorkflow JSON (*.json)|*.json";
            openFileDialog.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
            if (openFileDialog.ShowDialog() == true)
            {
                CurrentOperation = OperationSerializer.Deserialize(openFileDialog.FileName);

                VehicleCollection.Clear();
                foreach (var item in CurrentOperation.Resources)
                {
                    VehicleCollection.Add(item.FullName);
                }
            }
        }