Code:
/ FX-1434 / FX-1434 / 1.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
- DataControlReference.cs
- MemberDescriptor.cs
- PieceDirectory.cs
- RefreshEventArgs.cs
- DispatcherExceptionEventArgs.cs
- DbMetaDataFactory.cs
- ImageListStreamer.cs
- ChangePasswordDesigner.cs
- XmlSequenceWriter.cs
- XComponentModel.cs
- Transform3D.cs
- XMLSyntaxException.cs
- ProtectedConfigurationProviderCollection.cs
- HandleCollector.cs
- Composition.cs
- RegexCapture.cs
- SqlDataSourceStatusEventArgs.cs
- Hashtable.cs
- QilStrConcat.cs
- SmtpReplyReaderFactory.cs
- SafeFileHandle.cs
- DocumentGridContextMenu.cs
- SqlCommand.cs
- StyleSheetDesigner.cs
- SqlInternalConnectionTds.cs
- CatalogPartCollection.cs
- EntitySetDataBindingList.cs
- PrinterResolution.cs
- GridViewSelectEventArgs.cs
- EnumValAlphaComparer.cs
- CheckBox.cs
- ContentPlaceHolder.cs
- AnnotationObservableCollection.cs
- InternalCache.cs
- LineBreakRecord.cs
- SqlDependency.cs
- DynamicRenderer.cs
- ControlUtil.cs
- ZipIOExtraFieldPaddingElement.cs
- TableNameAttribute.cs
- LayoutTable.cs
- ExtendedProtectionPolicy.cs
- GridViewItemAutomationPeer.cs
- XPathPatternParser.cs
- CFStream.cs
- LicenseProviderAttribute.cs
- HtmlForm.cs
- EventProviderTraceListener.cs
- SettingsContext.cs
- TraceXPathNavigator.cs
- PageCache.cs
- OneOfConst.cs
- XmlDsigSep2000.cs
- EmbeddedMailObject.cs
- OleDbFactory.cs
- SQLDecimalStorage.cs
- SystemUdpStatistics.cs
- Int16KeyFrameCollection.cs
- RootProfilePropertySettingsCollection.cs
- OpenTypeCommon.cs
- EnvelopedPkcs7.cs
- CheckBoxPopupAdapter.cs
- DbModificationClause.cs
- ChooseAction.cs
- Byte.cs
- TemplateApplicationHelper.cs
- WrapperSecurityCommunicationObject.cs
- UriSection.cs
- GenericUriParser.cs
- UnsafeNativeMethods.cs
- EventSinkHelperWriter.cs
- MenuItemBinding.cs
- NativeCompoundFileAPIs.cs
- TemplateField.cs
- EdmFunction.cs
- SelectionPattern.cs
- PolyLineSegment.cs
- GridItemCollection.cs
- AssemblyInfo.cs
- ComplexTypeEmitter.cs
- GetFileNameResult.cs
- SweepDirectionValidation.cs
- MatrixAnimationUsingKeyFrames.cs
- filewebresponse.cs
- WorkflowMarkupSerializationException.cs
- HelpOperationInvoker.cs
- TableRowCollection.cs
- TextBlockAutomationPeer.cs
- InputMethod.cs
- OleDbConnectionInternal.cs
- MaterialGroup.cs
- SqlPersonalizationProvider.cs
- NativeObjectSecurity.cs
- Header.cs
- BamlLocalizationDictionary.cs
- StrokeCollection2.cs
- DocumentPageTextView.cs
- ExceptionHandlersDesigner.cs
- RenderingBiasValidation.cs
- WmfPlaceableFileHeader.cs