Пример #1
0
        private void SwitchTabImpl(SwitchTabCommand command)
        {
            // We don't attempt to null-check here, we need it to fail fast.
            model.CurrentWorkspace = model.Workspaces[command.TabIndex];

            if (command.IsInPlaybackMode)
                RaisePropertyChanged("CurrentWorkspaceIndex");
        }
Пример #2
0
 void SwitchWorkspaceImpl(SwitchTabCommand command)
 {
     // We don't attempt to null-check here, we need it to fail fast.
     CurrentWorkspace = Workspaces.ElementAt(command.WorkspaceModelIndex);
 }
Пример #3
0
            /// <summary>
            /// Call this static method to reconstruct a RecordableCommand-derived
            /// object given an XmlElement that was previously saved with Serialize
            /// method. This method simply redirects the XmlElement to respective
            /// RecordableCommand-derived classes based on its type.
            /// </summary>
            /// <param name="element">The XmlElement from which the RecordableCommand
            /// can be reconstructed.</param>
            /// <returns>Returns the reconstructed RecordableCommand object. If a
            /// RecordableCommand cannot be reconstructed, this method throws a
            /// relevant exception.</returns>
            ///
            internal static RecordableCommand Deserialize(XmlElement element)
            {
                if (string.IsNullOrEmpty(element.Name))
                {
                    throw new ArgumentException("XmlElement without name");
                }

                RecordableCommand command = null;

                switch (element.Name)
                {
                case "OpenFileCommand":
                    command = OpenFileCommand.DeserializeCore(element);
                    break;

                case "PausePlaybackCommand":
                    command = PausePlaybackCommand.DeserializeCore(element);
                    break;

                case "RunCancelCommand":
                    command = RunCancelCommand.DeserializeCore(element);
                    break;

                case "CreateNodeCommand":
                    command = CreateNodeCommand.DeserializeCore(element);
                    break;

                case "SelectModelCommand":
                    command = SelectModelCommand.DeserializeCore(element);
                    break;

                case "CreateNoteCommand":
                    command = CreateNoteCommand.DeserializeCore(element);
                    break;

                case "SelectInRegionCommand":
                    command = SelectInRegionCommand.DeserializeCore(element);
                    break;

                case "DragSelectionCommand":
                    command = DragSelectionCommand.DeserializeCore(element);
                    break;

                case "MakeConnectionCommand":
                    command = MakeConnectionCommand.DeserializeCore(element);
                    break;

                case "DeleteModelCommand":
                    command = DeleteModelCommand.DeserializeCore(element);
                    break;

                case "UndoRedoCommand":
                    command = UndoRedoCommand.DeserializeCore(element);
                    break;

                case "ModelEventCommand":
                    command = ModelEventCommand.DeserializeCore(element);
                    break;

                case "UpdateModelValueCommand":
                    command = UpdateModelValueCommand.DeserializeCore(element);
                    break;

                case "ConvertNodesToCodeCommand":
                    command = ConvertNodesToCodeCommand.DeserializeCore(element);
                    break;

                case "CreateCustomNodeCommand":
                    command = CreateCustomNodeCommand.DeserializeCore(element);
                    break;

                case "SwitchTabCommand":
                    command = SwitchTabCommand.DeserializeCore(element);
                    break;
                }

                if (null != command)
                {
                    command.IsInPlaybackMode = true;
                    command.Tag = element.GetAttribute("Tag");
                    return(command);
                }

                string message = string.Format("Unknown command: {0}", element.Name);

                throw new ArgumentException(message);
            }
Пример #4
0
 void SwitchWorkspaceImpl(SwitchTabCommand command)
 {
     // We don't attempt to null-check here, we need it to fail fast.
     CurrentWorkspace = Workspaces.ElementAt(command.WorkspaceModelIndex);
 }
Пример #5
0
 void SwitchTabImpl(SwitchTabCommand command)
 {
     // We don't attempt to null-check here, we need it to fail fast.
     CurrentWorkspace = Workspaces[command.TabIndex];
 }
Пример #6
0
 void SwitchTabImpl(SwitchTabCommand command)
 {
     // We don't attempt to null-check here, we need it to fail fast.
     CurrentWorkspace = Workspaces[command.TabIndex];
 }