private void SendModelEventImpl(ModelEventCommand command) { CurrentSpace.SendModelEvent(command.ModelGuid, command.EventName); UndoCommand.RaiseCanExecuteChanged(); RedoCommand.RaiseCanExecuteChanged(); }
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(); }
public void PlaySpace() { if (CurrentSpace != null) { CurrentSpace.ChangeState(State.Play); } }
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); } } }
public void EditSpace() { if (CurrentSpace != null) { CurrentSpace.ChangeState(State.Edit); } }
private void ConvertNodesToCodeImpl(ConvertNodesToCodeCommand command) { CurrentSpace.ConvertNodesToCodeInternal(command.NodeId); UndoCommand.RaiseCanExecuteChanged(); RedoCommand.RaiseCanExecuteChanged(); CurrentSpace.HasUnsavedChanges = true; }
private void UpdateModelValueImpl(UpdateModelValueCommand command) { CurrentSpace.UpdateModelValue(command.ModelGuid, command.Name, command.Value); UndoCommand.RaiseCanExecuteChanged(); RedoCommand.RaiseCanExecuteChanged(); }
private void CreateNoteImpl(CreateNoteCommand command) { NoteModel noteModel = Model.AddNoteInternal(command, null); CurrentSpace.RecordCreatedModel(noteModel); UndoCommand.RaiseCanExecuteChanged(); RedoCommand.RaiseCanExecuteChanged(); }
private void CreateNodeImpl(CreateNodeCommand command) { NodeModel nodeModel = Model.CreateNode( command.NodeId, command.NodeName, command.X, command.Y, command.DefaultPosition, command.TransformCoordinates); CurrentSpace.RecordCreatedModel(nodeModel); }
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); }); } }
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(); }
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(); }
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(); }
private void CreateNoteImpl(CreateNoteCommand command) { NoteModel noteModel = Model.AddNoteInternal(command, null); CurrentSpace.RecordCreatedModel(noteModel); }