Example #1
0
        private void OnWorkspaceCommandExecuted(Object sender, NefsEditCommandEventArgs e)
        {
            if (e.Command is ReplaceFileCommand replaceCommand)
            {
                if (!this.listItems.ContainsKey(replaceCommand.Item))
                {
                    // An item was replaced, but its not in the current view
                    return;
                }

                var listItem = this.listItems[replaceCommand.Item];
                this.UpdateListItem(listItem);
            }
            else if (e.Command is RemoveFileCommand removeCommand)
            {
                if (!this.listItems.ContainsKey(removeCommand.Item))
                {
                    // An item was removed, but its not in the current view
                    return;
                }

                var listItem = this.listItems[removeCommand.Item];
                this.UpdateListItem(listItem);
            }
        }
        public void Undo_CanNotUndo_CommandExecutedEventNotRaised()
        {
            var str    = new StringBuilder();
            var buffer = new UndoBuffer();

            NefsEditCommandEventArgs eventArgs = null;

            buffer.CommandExecuted += (o, e) => eventArgs = e;
            buffer.Undo();

            Assert.Null(eventArgs);
        }
        public void Execute_ValidCommand_CommandExecutedEventRaised()
        {
            var str    = new StringBuilder();
            var buffer = new UndoBuffer();
            var cmd1   = new TestCommand(str, "", "A");

            NefsEditCommandEventArgs eventArgs = null;

            buffer.CommandExecuted += (o, e) => eventArgs = e;
            buffer.Execute(cmd1);

            Assert.Same(cmd1, eventArgs.Command);
            Assert.Equal(NefsEditCommandEventKind.New, eventArgs.Kind);
        }
Example #4
0
 private void OnWorkspaceCommandExecuted(object sender, NefsEditCommandEventArgs e)
 {
     this.UpdateTitle();
     this.UpdateMenuItems();
     this.selectedFilePropertyForm.RefreshGrid();
 }