Exemple #1
0
        private void SendModelEventImpl(ModelEventCommand command)
        {
            CurrentSpace.SendModelEvent(command.ModelGuid, command.EventName);

            UndoCommand.RaiseCanExecuteChanged();
            RedoCommand.RaiseCanExecuteChanged();
        }
Exemple #2
0
        private void DeleteModelImpl(DeleteModelCommand command)
        {
            List <ModelBase> modelsToDelete = new List <ModelBase>();

            if (command.ModelGuid != Guid.Empty)
            {
                modelsToDelete.Add(CurrentSpace.GetModelInternal(command.ModelGuid));
            }
            else
            {
                // When nothing is specified then it means all selected models.
                foreach (ISelectable selectable in DynamoSelection.Instance.Selection)
                {
                    if (selectable is ModelBase)
                    {
                        modelsToDelete.Add(selectable as ModelBase);
                    }
                }
            }

            model.DeleteModelInternal(modelsToDelete);

            UndoCommand.RaiseCanExecuteChanged();
            RedoCommand.RaiseCanExecuteChanged();
        }
Exemple #3
0
 public void PlaySpace()
 {
     if (CurrentSpace != null)
     {
         CurrentSpace.ChangeState(State.Play);
     }
 }
Exemple #4
0
        private void SelectModelImpl(SelectModelCommand command)
        {
            // Empty ModelGuid means clear selection.
            if (command.ModelGuid == Guid.Empty)
            {
                DynamoSelection.Instance.ClearSelection();
                return;
            }

            ModelBase model = CurrentSpace.GetModelInternal(command.ModelGuid);

            if (false == model.IsSelected)
            {
                if (!command.Modifiers.HasFlag(ModifierKeys.Shift))
                {
                    DynamoSelection.Instance.ClearSelection();
                }

                if (!DynamoSelection.Instance.Selection.Contains(model))
                {
                    DynamoSelection.Instance.Selection.Add(model);
                }
            }
            else
            {
                if (command.Modifiers.HasFlag(ModifierKeys.Shift))
                {
                    DynamoSelection.Instance.Selection.Remove(model);
                }
            }
        }
Exemple #5
0
 public void EditSpace()
 {
     if (CurrentSpace != null)
     {
         CurrentSpace.ChangeState(State.Edit);
     }
 }
Exemple #6
0
        private void ConvertNodesToCodeImpl(ConvertNodesToCodeCommand command)
        {
            CurrentSpace.ConvertNodesToCodeInternal(command.NodeId);

            UndoCommand.RaiseCanExecuteChanged();
            RedoCommand.RaiseCanExecuteChanged();
            CurrentSpace.HasUnsavedChanges = true;
        }
Exemple #7
0
        private void UpdateModelValueImpl(UpdateModelValueCommand command)
        {
            CurrentSpace.UpdateModelValue(command.ModelGuid,
                                          command.Name, command.Value);

            UndoCommand.RaiseCanExecuteChanged();
            RedoCommand.RaiseCanExecuteChanged();
        }
Exemple #8
0
        private void CreateNoteImpl(CreateNoteCommand command)
        {
            NoteModel noteModel = Model.AddNoteInternal(command, null);

            CurrentSpace.RecordCreatedModel(noteModel);

            UndoCommand.RaiseCanExecuteChanged();
            RedoCommand.RaiseCanExecuteChanged();
        }
Exemple #9
0
        private void CreateNodeImpl(CreateNodeCommand command)
        {
            NodeModel nodeModel = Model.CreateNode(
                command.NodeId,
                command.NodeName,
                command.X,
                command.Y,
                command.DefaultPosition,
                command.TransformCoordinates);

            CurrentSpace.RecordCreatedModel(nodeModel);
        }
Exemple #10
0
        public void SaveCurrentSpace()
        {
            if (CurrentSpace != null)
            {
                var graph = CurrentSpace.Save();

                var timer = TimerWidget.CreateTimer(2, true, true);
                timer.DescriptiveName = "Saving...";
                timer.transform.SetParent(AvatarWidget.UserAvatar.transform);//Avatar.transform);
                timer.OnEnd.AddListener(delegate { Destroy(timer.gameObject); });
            }
        }
Exemple #11
0
        private void UndoRedoImpl(UndoRedoCommand command)
        {
            if (command.CmdOperation == UndoRedoCommand.Operation.Undo)
            {
                CurrentSpace.Undo();
            }
            else if (command.CmdOperation == UndoRedoCommand.Operation.Redo)
            {
                CurrentSpace.Redo();
            }

            UndoCommand.RaiseCanExecuteChanged();
            RedoCommand.RaiseCanExecuteChanged();
        }
Exemple #12
0
        private void CreateNoteImpl(CreateNoteCommand command)
        {
            NoteModel noteModel = Model.CurrentWorkspace.AddNote(
                command.DefaultPosition,
                command.X,
                command.Y,
                command.NoteText,
                command.NodeId);

            CurrentSpace.RecordCreatedModel(noteModel);

            UndoCommand.RaiseCanExecuteChanged();
            RedoCommand.RaiseCanExecuteChanged();
        }
Exemple #13
0
        private void CreateNodeImpl(CreateNodeCommand command)
        {
            NodeModel nodeModel = CurrentSpace.AddNode(
                command.NodeId,
                command.NodeName,
                command.X,
                command.Y,
                command.DefaultPosition,
                command.TransformCoordinates);

            CurrentSpace.RecordCreatedModel(nodeModel);

            UndoCommand.RaiseCanExecuteChanged();
            RedoCommand.RaiseCanExecuteChanged();
        }
Exemple #14
0
        private void CreateNoteImpl(CreateNoteCommand command)
        {
            NoteModel noteModel = Model.AddNoteInternal(command, null);

            CurrentSpace.RecordCreatedModel(noteModel);
        }