public bool HandleCommand(Command command)
        {
            bool flag = false;
            if (command.CommandGroup == typeof(TextBufferCommands))
            {
                TextBufferCommand command2 = (TextBufferCommand) command;
                TextBufferLocation startLocation = command2.StartLocation;
                TextBufferLocation endLocation = command2.EndLocation;
                switch (command.CommandID)
                {
                    case 0x5c:
                        this.BlockComment(new TextBufferSpan(startLocation, endLocation));
                        flag = true;
                        break;

                    case 0x5d:
                        this.BlockUncomment(new TextBufferSpan(startLocation, endLocation));
                        flag = true;
                        break;
                }
            }
            if (!flag)
            {
                flag = this._nextHandler.HandleCommand(command);
            }
            return flag;
        }
 public bool HandleCommand(Command command)
 {
     bool flag = false;
     if (command.CommandGroup == typeof(TextBufferCommands))
     {
         TextBufferCommand command2 = (TextBufferCommand) command;
         TextBufferLocation startLocation = command2.StartLocation;
         if (command.CommandID == 20)
         {
             this._nextHandler.HandleCommand(new TextBufferCommand(7));
             this._nextHandler.HandleCommand(command);
             TextLine previous = startLocation.Line.Previous;
             int length = 0;
             while (length < previous.Length)
             {
                 if ((previous[length] != '\t') && (previous[length] != ' '))
                 {
                     break;
                 }
                 length++;
             }
             if (length != 0)
             {
                 this._nextHandler.HandleCommand(new TextBufferCommand(4, startLocation, previous.Substring(0, length)));
             }
             this._nextHandler.HandleCommand(new TextBufferCommand(8));
             flag = true;
         }
     }
     if (!flag)
     {
         flag = this._nextHandler.HandleCommand(command);
     }
     return flag;
 }
Example #3
0
 bool ICommandHandler.HandleCommand(Command command)
 {
     if ((command.CommandGroup == typeof(GlobalCommands)) && (command.CommandID == 0x259))
     {
         this.OnCommandHelpAbout();
         return true;
     }
     return false;
 }
 protected override bool HandleCommand(Command command)
 {
     bool flag = false;
     if ((command.CommandGroup == typeof(GlobalCommands)) && (command.CommandID == 4))
     {
         flag = true;
     }
     if (!flag)
     {
         flag = base.HandleCommand(command);
     }
     return flag;
 }
Example #5
0
 protected override bool UpdateCommand(Command command)
 {
     bool flag = false;
     if ((command.CommandGroup == typeof(WebCommands)) && (command.CommandID == 240))
     {
         command.Enabled = false;
         flag = true;
     }
     if (!flag)
     {
         flag = base.UpdateCommand(command);
     }
     return flag;
 }
Example #6
0
 protected override bool HandleCommand(Command command)
 {
     bool flag = false;
     if ((command.CommandGroup == typeof(WebCommands)) && (command.CommandID == 250))
     {
         StringWriter output = new StringWriter();
         HtmlFormatter formatter = new HtmlFormatter();
         base.ClearSelection();
         formatter.Format(this.Text, output, new HtmlFormatterOptions(' ', 4, 80, true));
         output.Flush();
         base.SetText(output.ToString(), true);
         flag = true;
     }
     if (!flag)
     {
         flag = base.HandleCommand(command);
     }
     return flag;
 }
Example #7
0
 protected override bool UpdateCommand(Command command)
 {
     bool flag = false;
     if (((command.CommandGroup == typeof(GlobalCommands)) && (command.CommandID >= 200)) && (command.CommandID <= 0xcb))
     {
         flag = base.UpdateCommand(command);
         IMultiViewDocumentWindow window = this;
         WebFormsDesignView currentView = window.CurrentView as WebFormsDesignView;
         if ((currentView != null) && currentView.InTemplateMode)
         {
             command.Enabled = false;
             flag = true;
         }
     }
     if (!flag)
     {
         flag = base.UpdateCommand(command);
     }
     return flag;
 }
        public bool UpdateCommand(Command command)
        {
            bool flag = false;
            if (command.CommandGroup == typeof(TextBufferCommands))
            {
                switch (command.CommandID)
                {
                    case 0x5c:
                        command.Enabled = this._view.SelectionExists;
                        flag = true;
                        break;

                    case 0x5d:
                        command.Enabled = this._view.SelectionExists;
                        flag = true;
                        break;
                }
            }
            if (!flag)
            {
                flag = this._nextHandler.UpdateCommand(command);
            }
            return flag;
        }
        public bool HandleCommand(Command command)
        {
            bool flag = false;
            if (command.CommandGroup == typeof(TextBufferCommands))
            {
                TextBufferCommand command2 = (TextBufferCommand) command;
                if (!this._view.ReadOnly)
                {
                    char data;
                    TextBufferLocation startLocation;
                    switch (command.CommandID)
                    {
                        case 1:
                            data = (char) command2.Data;
                            if (data > '\x001f')
                            {
                                this._buffer.InsertChar(command2.StartLocation, data);
                            }
                            flag = true;
                            break;

                        case 2:
                            this._buffer.DeleteChar(command2.StartLocation);
                            flag = true;
                            break;

                        case 3:
                            this._buffer.DeleteText(new TextBufferSpan(command2.StartLocation, command2.EndLocation));
                            flag = true;
                            break;

                        case 4:
                            this._buffer.InsertText(command2.StartLocation, (string) command2.Data);
                            flag = true;
                            break;

                        case 5:
                            this._buffer.Undo(command2.StartLocation);
                            flag = true;
                            break;

                        case 6:
                            this._buffer.Redo(command2.StartLocation);
                            flag = true;
                            break;

                        case 7:
                            this._buffer.BeginBatchUndo();
                            flag = true;
                            break;

                        case 8:
                            this._buffer.EndBatchUndo();
                            flag = true;
                            break;

                        case 9:
                            data = (char) command2.Data;
                            if (data > '\x001f')
                            {
                                this._buffer.ReplaceChar(command2.StartLocation, data);
                            }
                            flag = true;
                            break;

                        case 20:
                            this._buffer.InsertText(command2.StartLocation, this._newLineTextList);
                            flag = true;
                            break;

                        case 70:
                            startLocation = ((TextBufferCommand) command).StartLocation;
                            ((TextBufferCommand) command).CommandValue = this.InsertTab(startLocation);
                            flag = true;
                            break;

                        case 0x47:
                            startLocation = ((TextBufferCommand) command).StartLocation;
                            ((TextBufferCommand) command).CommandValue = this.RemoveTab(startLocation);
                            flag = true;
                            break;
                    }
                }
            }
            if (!flag)
            {
                flag = this._view.HandleViewCommand(command);
            }
            return flag;
        }
        public bool UpdateCommand(Command command)
        {
            bool flag = false;
            if (command.CommandGroup == typeof(TextBufferCommands))
            {
                TextBufferCommand command1 = (TextBufferCommand) command;
                switch (command.CommandID)
                {
                    case 5:
                        command.Enabled = this._buffer.CanUndo;
                        flag = true;
                        break;

                    case 6:
                        command.Enabled = this._buffer.CanRedo;
                        flag = true;
                        break;
                }
            }
            if (!flag)
            {
                flag = this._view.UpdateViewCommand(command);
            }
            return flag;
        }
Example #11
0
 bool ICommandHandler.UpdateCommand(Command command)
 {
     return ((command.CommandGroup == typeof(GlobalCommands)) && (command.CommandID == 0x259));
 }
Example #12
0
 protected virtual bool UpdateCommand(Command command)
 {
     return false;
 }
Example #13
0
 protected virtual bool HandleCommand(Command command)
 {
     return false;
 }
Example #14
0
 bool ICommandHandler.UpdateCommand(Command command)
 {
     return this.UpdateCommand(command);
 }
Example #15
0
 bool ICommandHandler.HandleCommand(Command command)
 {
     return this.HandleCommand(command);
 }
 public bool UpdateCommand(Command command)
 {
     return this._nextHandler.UpdateCommand(command);
 }