Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / Designer / CompMod / System / ComponentModel / Design / DesignerActionMethodItem.cs / 1 / DesignerActionMethodItem.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.ComponentModel.Design { using System; using System.ComponentModel; using System.Design; using System.Reflection; ////// /// [to be provided] /// public class DesignerActionMethodItem : DesignerActionItem { private string memberName; private bool includeAsDesignerVerb; private DesignerActionList actionList; private MethodInfo methodInfo; private IComponent relatedComponent; ////// /// [to be provvided] /// public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName, string category, string description, bool includeAsDesignerVerb) : base( displayName, category, description) { this.actionList = actionList; this.memberName = memberName; this.includeAsDesignerVerb = includeAsDesignerVerb; } ////// /// [to be provvided] /// public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName) : this(actionList, memberName, displayName, null, null, false) { } ////// /// [to be provvided] /// public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName, bool includeAsDesignerVerb) : this(actionList, memberName, displayName, null, null, includeAsDesignerVerb) { } ////// /// [to be provvided] /// public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName, string category) : this(actionList, memberName, displayName, category, null, false) { } ////// /// [to be provvided] /// public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName, string category, bool includeAsDesignerVerb) : this(actionList, memberName, displayName, category, null, includeAsDesignerVerb) { } ////// /// [to be provvided] /// public DesignerActionMethodItem(DesignerActionList actionList, string memberName, string displayName, string category, string description) : this(actionList, memberName, displayName, category, description, false) { } internal DesignerActionMethodItem() { } ////// /// [to be provvided] /// public virtual string MemberName { get { return memberName; } } ////// /// [to be provvided] /// public IComponent RelatedComponent { get { return relatedComponent; } set { relatedComponent = value; } } ////// /// [to be provvided] /// public virtual bool IncludeAsDesignerVerb { get { return includeAsDesignerVerb; } } // this is only use for verbs so that a designer action method item can // be converted to a verb. Verbs use an EventHandler to call their invoke // so we need a way to translate the EventHandler Invoke into ou own Invoke internal void Invoke(object sender, EventArgs args) { Invoke(); } public virtual void Invoke() { if (methodInfo == null) { // we look public AND private or protected methods methodInfo = actionList.GetType().GetMethod(memberName, BindingFlags.Default | BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); } if (methodInfo != null) { methodInfo.Invoke(actionList, null); } else { throw new InvalidOperationException(SR.GetString(SR.DesignerActionPanel_CouldNotFindMethod, MemberName)); } } } } // 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
- ISAPIApplicationHost.cs
- unitconverter.cs
- DependencyPropertyKey.cs
- ReadOnlyHierarchicalDataSource.cs
- ResourcesBuildProvider.cs
- PrivacyNoticeBindingElement.cs
- serverconfig.cs
- ReferencedType.cs
- ArgumentNullException.cs
- SharedDp.cs
- InstanceData.cs
- DesigntimeLicenseContextSerializer.cs
- ImageDrawing.cs
- MetafileEditor.cs
- HuffModule.cs
- VisualProxy.cs
- EncryptedPackage.cs
- TextElementEnumerator.cs
- ThicknessAnimationBase.cs
- DisplayToken.cs
- LayoutInformation.cs
- IpcChannel.cs
- SimpleMailWebEventProvider.cs
- TracedNativeMethods.cs
- XmlSchemaChoice.cs
- ConnectionProviderAttribute.cs
- MemberPathMap.cs
- templategroup.cs
- AuthenticateEventArgs.cs
- XpsDigitalSignature.cs
- HttpCapabilitiesBase.cs
- RuntimeHandles.cs
- QilParameter.cs
- HMACSHA512.cs
- Control.cs
- AssemblyBuilder.cs
- CheckBoxPopupAdapter.cs
- MobileFormsAuthentication.cs
- ColorAnimationUsingKeyFrames.cs
- ExpressionBinding.cs
- CodeIdentifiers.cs
- transactioncontext.cs
- EditorPartCollection.cs
- PageContentAsyncResult.cs
- MemoryResponseElement.cs
- RepeaterItemEventArgs.cs
- XmlSchemaRedefine.cs
- ZipIOZip64EndOfCentralDirectoryLocatorBlock.cs
- Oci.cs
- DocumentPage.cs
- ProxyGenerator.cs
- HostProtectionException.cs
- TextSpanModifier.cs
- CriticalExceptions.cs
- TextBlockAutomationPeer.cs
- Util.cs
- MetricEntry.cs
- HijriCalendar.cs
- BrowserCapabilitiesFactory.cs
- UrlMappingsSection.cs
- MappingException.cs
- WebBrowserEvent.cs
- TaskFileService.cs
- AsyncPostBackErrorEventArgs.cs
- FocusWithinProperty.cs
- HtmlInputRadioButton.cs
- ResXResourceWriter.cs
- SettingsAttributes.cs
- ToolStripEditorManager.cs
- EmptyStringExpandableObjectConverter.cs
- CommonGetThemePartSize.cs
- MulticastNotSupportedException.cs
- assertwrapper.cs
- FontFamilyIdentifier.cs
- TypeDependencyAttribute.cs
- XmlSchemaParticle.cs
- WebPartAddingEventArgs.cs
- BitmapImage.cs
- StringResourceManager.cs
- Vars.cs
- RoleManagerEventArgs.cs
- StdValidatorsAndConverters.cs
- DefaultEventAttribute.cs
- ProcessMessagesAsyncResult.cs
- ContextQuery.cs
- DbProviderFactories.cs
- WindowsStatusBar.cs
- FormParameter.cs
- GPPOINTF.cs
- UnknownBitmapDecoder.cs
- namescope.cs
- IdleTimeoutMonitor.cs
- HwndHostAutomationPeer.cs
- SelectionEditor.cs
- WebPartRestoreVerb.cs
- CodeNamespaceCollection.cs
- DateTimeFormatInfoScanner.cs
- IteratorFilter.cs
- ArgumentOutOfRangeException.cs
- SystemEvents.cs