예제 #1
0
 public void DoAction(PlaylistAction action)
 {
     action.Do();
     undoHistory.Push(action);
     redoHistory.Clear();
     ActionDone?.Invoke(this, action);
 }
예제 #2
0
 protected virtual void onActionDone()
 {
     if (ActionDone != null)
     {
         ActionDone.Invoke();
     }
 }
예제 #3
0
        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));
        }
예제 #4
0
 public override void Do(T valueObject)
 {
     ActionDone?.Invoke(this, new SuperFormEventArgs <T>()
     {
         ValueObject = valueObject,
         Operation   = this
     });
 }
예제 #5
0
 public void Perform(Vector2 location)
 {
     performCalled = true;
     if (ActionDone != null)
     {
         ActionDone.Invoke(this, new ActionDoneEventArgs(updatablePolygon));
     }
 }
예제 #6
0
        /// <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;
                }
            }
        }
예제 #7
0
 // TOOD implement advanced Disose pattern
 public void Dispose()
 {
     if (ActionDone != null)
     {
         foreach (var item in ActionDone.GetInvocationList())
         {
             ActionDone -= (EndPerformAction)item;
         }
     }
 }
예제 #8
0
 // Start is called before the first frame update
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
예제 #9
0
 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);
 }
예제 #10
0
 /// <summary>
 /// Called when <see cref="Undo"/> performs action.
 /// </summary>
 /// <param name="action">The action.</param>
 protected virtual void OnAction(IUndoAction action)
 {
     ActionDone?.Invoke();
 }
예제 #11
0
 private void HandleNextLevelButtonClick()
 {
     ActionDone?.Invoke(this, new UIViewActionArgs(ViewActionType.NextLevelButtonClick, CustomObject.Empty));
 }