public void DoAction(PlaylistAction action) { action.Do(); undoHistory.Push(action); redoHistory.Clear(); ActionDone?.Invoke(this, action); }
protected virtual void onActionDone() { if (ActionDone != null) { ActionDone.Invoke(); } }
private IEnumerator ShowLevelWindCoroutine() { _levelWinText.gameObject.SetActive(true); yield return(new WaitForSeconds(_timeShowLevelWinText)); _levelWinText.gameObject.SetActive(false); ActionDone?.Invoke(this, new UIViewActionArgs(ViewActionType.NextLevelButtonClick, CustomObject.Empty)); }
public override void Do(T valueObject) { ActionDone?.Invoke(this, new SuperFormEventArgs <T>() { ValueObject = valueObject, Operation = this }); }
public void Perform(Vector2 location) { performCalled = true; if (ActionDone != null) { ActionDone.Invoke(this, new ActionDoneEventArgs(updatablePolygon)); } }
/// <summary> /// Runs all actions /// </summary> public void RunAllActions() { for (int i = 0; i < Actions.Count; i++) { switch (Actions[i].Type) { case PublisherTypes.ActionType.CreateDirectory: Actions[i].Result = PublisherIO.CreateDirectory(Actions[i].TargetPath, _CurrentUserSecurity); ActionDone?.Invoke(i + 1, Actions.Count, Actions[i]); break; case PublisherTypes.ActionType.ArchiveDirectory: Actions[i].Result = PublisherIO.ArchiveDirectory(Actions[i].SourcePath, _CurrentUserSecurity, Actions[i].TargetPath); ActionDone?.Invoke(i + 1, Actions.Count, Actions[i]); break; case PublisherTypes.ActionType.ArchiveDirectoryOverwrite: Actions[i].Result = PublisherIO.ArchiveDirectory(Actions[i].SourcePath, _CurrentUserSecurity, Actions[i].TargetPath, overwritearchive: true); ActionDone?.Invoke(i + 1, Actions.Count, Actions[i]); break; case PublisherTypes.ActionType.ArchiveFile: Actions[i].Result = PublisherIO.ArchiveFile(Actions[i].SourcePath, _CurrentUserSecurity, Actions[i].TargetPath); ActionDone?.Invoke(i + 1, Actions.Count, Actions[i]); break; case PublisherTypes.ActionType.ArchiveFileOverwrite: Actions[i].Result = PublisherIO.ArchiveFile(Actions[i].SourcePath, _CurrentUserSecurity, Actions[i].TargetPath, overwritearchvie: true); ActionDone?.Invoke(i + 1, Actions.Count, Actions[i]); break; case PublisherTypes.ActionType.CopyFileToDirectory: Actions[i].Result = PublisherIO.CopyFileToDirectory(Actions[i].SourcePath, Actions[i].TargetPath, _CurrentUserSecurity, false); ActionDone?.Invoke(i + 1, Actions.Count, Actions[i]); break; case PublisherTypes.ActionType.CopyFileToDirectoryOverwrite: Actions[i].Result = PublisherIO.CopyFileToDirectory(Actions[i].SourcePath, Actions[i].TargetPath, _CurrentUserSecurity, true); ActionDone?.Invoke(i + 1, Actions.Count, Actions[i]); break; case PublisherTypes.ActionType.CopyFileToFile: Actions[i].Result = PublisherIO.CopyFileToFile(Actions[i].SourcePath, Actions[i].TargetPath, _CurrentUserSecurity, false); ActionDone?.Invoke(i + 1, Actions.Count, Actions[i]); break; case PublisherTypes.ActionType.CopyFileToFileOverwrite: Actions[i].Result = PublisherIO.CopyFileToFile(Actions[i].SourcePath, Actions[i].TargetPath, _CurrentUserSecurity, true); ActionDone?.Invoke(i + 1, Actions.Count, Actions[i]); break; default: break; } } }
// TOOD implement advanced Disose pattern public void Dispose() { if (ActionDone != null) { foreach (var item in ActionDone.GetInvocationList()) { ActionDone -= (EndPerformAction)item; } } }
// Start is called before the first frame update void Awake() { if (instance == null) { instance = this; } else { Destroy(this); } }
private void HandleComponentActionDone(object sender, UIViewActionArgs args) { foreach (var uiComponentView in _components) { if (uiComponentView != sender) { uiComponentView?.SendAction(args.ActionType, args.Data); } } ActionDone?.Invoke(sender, args); }
/// <summary> /// Called when <see cref="Undo"/> performs action. /// </summary> /// <param name="action">The action.</param> protected virtual void OnAction(IUndoAction action) { ActionDone?.Invoke(); }
private void HandleNextLevelButtonClick() { ActionDone?.Invoke(this, new UIViewActionArgs(ViewActionType.NextLevelButtonClick, CustomObject.Empty)); }