Code:
/ FX-1434 / FX-1434 / 1.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / WinForms / System / WinForms / Design / Behavior / DesignerActionKeyboardBehavior.cs / 1 / DesignerActionKeyboardBehavior.cs
namespace System.Windows.Forms.Design.Behavior { using System; using System.Collections; using System.ComponentModel; using System.ComponentModel.Design; using System.Design; using System.Diagnostics; using System.Drawing; using System.Windows.Forms.Design; using System.Diagnostics.CodeAnalysis; ////// /// internal sealed class DesignerActionKeyboardBehavior : Behavior { private DesignerActionPanel panel; private IMenuCommandService menuService; private DesignerActionUIService daUISvc; private static readonly Guid VSStandardCommandSet97 = new Guid("{5efc7975-14bc-11cf-9b2b-00aa00573819}"); public DesignerActionKeyboardBehavior(DesignerActionPanel panel, IServiceProvider serviceProvider, BehaviorService behaviorService) : base(true, behaviorService) { this.panel = panel; if(serviceProvider != null) { this.menuService = serviceProvider.GetService(typeof(IMenuCommandService)) as IMenuCommandService; Debug.Assert(menuService != null, "we should have found a menu service here..."); this.daUISvc = serviceProvider.GetService(typeof(DesignerActionUIService)) as DesignerActionUIService; } } // THIS shoudl not stay here, creation of a custom command or of the real thing should be handled in the // designeractionpanel itself public override MenuCommand FindCommand(CommandID commandId) { if(panel != null && menuService != null) { // if the command we're looking for is handled by the panel, just tell VS that this command is // disabled. otherwise let it through as usual... foreach(CommandID candidateCommandId in panel.FilteredCommandIDs) { if(candidateCommandId.Equals(commandId)) { MenuCommand dummyMC = new MenuCommand(delegate{}, commandId); dummyMC.Enabled = false; //Debug.WriteLine("Found command id in DesignerActionPAnel supported commands"); return dummyMC; } } // in case of a ctrl-tab we need to close the DAP if (daUISvc != null && commandId.Guid == DesignerActionKeyboardBehavior.VSStandardCommandSet97 && commandId.ID == 1124) { daUISvc.HideUI(null); } } //Debug.WriteLine("NOT Found command id in DesignerActionPAnel supported commands. ASking base..."); return base.FindCommand(commandId); // this will route the request to the parent behavior } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- HostingMessageProperty.cs
- FontFamily.cs
- TraceProvider.cs
- EntityProviderServices.cs
- CompiledRegexRunnerFactory.cs
- CodeDomSerializer.cs
- XmlSchemaDatatype.cs
- DataListItem.cs
- CaseInsensitiveComparer.cs
- RegexCode.cs
- HostProtectionPermission.cs
- SqlUDTStorage.cs
- WhitespaceRuleReader.cs
- FormsAuthenticationUser.cs
- AssemblyCache.cs
- ExternalDataExchangeClient.cs
- DataGridViewImageCell.cs
- TextMessageEncodingBindingElement.cs
- ControlCachePolicy.cs
- DbInsertCommandTree.cs
- StringFunctions.cs
- TdsParserSessionPool.cs
- InstanceDataCollection.cs
- DataGridViewCellConverter.cs
- ApplicationFileCodeDomTreeGenerator.cs
- ETagAttribute.cs
- RowParagraph.cs
- AuthenticationModulesSection.cs
- DataSourceControl.cs
- LinearGradientBrush.cs
- CmsInterop.cs
- SystemIcons.cs
- UserPreferenceChangingEventArgs.cs
- PropertyMap.cs
- ExpressionParser.cs
- ColumnMapCopier.cs
- EncoderBestFitFallback.cs
- ConfigurationErrorsException.cs
- TextEndOfParagraph.cs
- MatrixAnimationUsingKeyFrames.cs
- ExplicitDiscriminatorMap.cs
- ConstNode.cs
- SetterBaseCollection.cs
- SQLUtility.cs
- VersionConverter.cs
- GlobalizationAssembly.cs
- EntitySqlQueryState.cs
- ToolStripItemTextRenderEventArgs.cs
- ListBase.cs
- WinFormsSecurity.cs
- ProfileSection.cs
- WindowInteractionStateTracker.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- RecognizedPhrase.cs
- DataGridPagingPage.cs
- HtmlControl.cs
- ResourceSet.cs
- ExitEventArgs.cs
- ToolStripOverflow.cs
- SortExpressionBuilder.cs
- _NativeSSPI.cs
- SystemWebSectionGroup.cs
- X509ChainElement.cs
- DuplexChannelFactory.cs
- XmlExpressionDumper.cs
- TTSEngineProxy.cs
- BinaryConverter.cs
- ImageSource.cs
- Popup.cs
- XmlBaseWriter.cs
- ColumnProvider.cs
- DataContractSerializerElement.cs
- CharAnimationUsingKeyFrames.cs
- ServiceProviders.cs
- ConfigurationCollectionAttribute.cs
- CategoryEditor.cs
- WasEndpointConfigContainer.cs
- LongValidatorAttribute.cs
- VisualStyleTypesAndProperties.cs
- DataTableMappingCollection.cs
- SqlDataSourceConnectionPanel.cs
- CompositeActivityValidator.cs
- OutputCacheSection.cs
- ImageIndexConverter.cs
- ObjectHelper.cs
- MimeObjectFactory.cs
- User.cs
- Point.cs
- DataColumnPropertyDescriptor.cs
- SyntaxCheck.cs
- TracePayload.cs
- LabelLiteral.cs
- MouseGesture.cs
- TablePattern.cs
- CroppedBitmap.cs
- UInt64.cs
- FlowDocumentPaginator.cs
- XamlSerializerUtil.cs
- ColorConvertedBitmap.cs
- Component.cs