public virtual bool CanExecuteCommand(string action) { if (_ieBrowser.Visible) { return(_ieBrowser.CanExecuteCommand(action)); } if (_editRtfBody.Visible) { return(_editRtfBody.CanExecuteCommand(action)); } return(false); }
/// <summary> /// Checks if the command with the specified ID can be executed in the current state /// of the control. /// </summary> /// <param name="command">The ID of the command.</param> /// <returns>true if the ID of the command is known to the control and can be /// executed; false otherwise.</returns> public bool CanExecuteCommand(string command) { // Delegate to the proper control if (_edtName.Focused) { return(_edtName.CanExecuteCommand(command)); } else if (_edtAnnotation.Focused) { return(_edtAnnotation.CanExecuteCommand(command)); } else if (_richTextBox.Focused) { return(_richTextBox.CanExecuteCommand(command)); } else { return(_browser.CanExecuteCommand(command)); } }