Code:
/ DotNET / DotNET / 8.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
- _AcceptOverlappedAsyncResult.cs
- BamlResourceSerializer.cs
- SignatureToken.cs
- Soap.cs
- ClientType.cs
- SizeAnimationClockResource.cs
- ProviderCommandInfoUtils.cs
- Range.cs
- KnownTypeAttribute.cs
- DataServiceQueryException.cs
- RepeatInfo.cs
- TypeCodeDomSerializer.cs
- Monitor.cs
- AppDomainProtocolHandler.cs
- indexingfiltermarshaler.cs
- ProfileManager.cs
- SqlUDTStorage.cs
- PropertyNames.cs
- SimpleBitVector32.cs
- ProfileEventArgs.cs
- Camera.cs
- Screen.cs
- SmiEventSink.cs
- HierarchicalDataSourceControl.cs
- mansign.cs
- DoneReceivingAsyncResult.cs
- UIntPtr.cs
- XmlSchemaParticle.cs
- WebPartZoneCollection.cs
- XsltLibrary.cs
- TreeBuilderXamlTranslator.cs
- TableCell.cs
- CurrentChangingEventManager.cs
- ObjectNotFoundException.cs
- ObjectSelectorEditor.cs
- SHA256.cs
- ContextMarshalException.cs
- TypeConverters.cs
- MyContact.cs
- HtmlButton.cs
- SiteMapDataSource.cs
- MobileCategoryAttribute.cs
- Rect3DConverter.cs
- TemplateBindingExtension.cs
- Expander.cs
- ByteAnimationUsingKeyFrames.cs
- TextBlock.cs
- IdentityReference.cs
- DataGridViewColumnDividerDoubleClickEventArgs.cs
- WorkflowRuntimeSection.cs
- Html32TextWriter.cs
- XmlAttributeProperties.cs
- QueryResponse.cs
- IdentityReference.cs
- Quaternion.cs
- FigureHelper.cs
- InProcStateClientManager.cs
- Brush.cs
- StackBuilderSink.cs
- sqlinternaltransaction.cs
- SqlUtils.cs
- ObjectList.cs
- PublisherIdentityPermission.cs
- MDIWindowDialog.cs
- XsdValidatingReader.cs
- IpcChannel.cs
- DesignerVerbCollection.cs
- CollaborationHelperFunctions.cs
- SecurityUtils.cs
- UpDownBase.cs
- Guid.cs
- LayoutSettings.cs
- StylusCaptureWithinProperty.cs
- PermissionListSet.cs
- DelayedRegex.cs
- FixedDSBuilder.cs
- ScriptReferenceEventArgs.cs
- HierarchicalDataBoundControl.cs
- SmtpReplyReaderFactory.cs
- InputMethod.cs
- UpdateManifestForBrowserApplication.cs
- IncomingWebRequestContext.cs
- PasswordRecovery.cs
- DesignerCapabilities.cs
- BrowserDefinition.cs
- ResourcePool.cs
- SecurityPolicySection.cs
- ProfileBuildProvider.cs
- StreamWithDictionary.cs
- _Win32.cs
- SimpleParser.cs
- SamlAssertionDirectKeyIdentifierClause.cs
- ImageDesigner.cs
- InputLangChangeRequestEvent.cs
- ConnectionManager.cs
- ResolvedKeyFrameEntry.cs
- InvokeMethodActivityDesigner.cs
- RuntimeArgumentHandle.cs
- HttpRequestWrapper.cs
- COM2PropertyBuilderUITypeEditor.cs