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
- Translator.cs
- OdbcFactory.cs
- NetworkStream.cs
- CatalogZoneBase.cs
- UriSection.cs
- XmlTextReader.cs
- QueryStringParameter.cs
- DrawTreeNodeEventArgs.cs
- TemplateEditingFrame.cs
- RoutingConfiguration.cs
- OleDbSchemaGuid.cs
- StoreItemCollection.Loader.cs
- ComponentCommands.cs
- DataGridViewCell.cs
- CodeIterationStatement.cs
- RewritingValidator.cs
- DataSourceHelper.cs
- IndexingContentUnit.cs
- HtmlTextBoxAdapter.cs
- LinqDataView.cs
- DataGridViewDataErrorEventArgs.cs
- X509Chain.cs
- BitmapDecoder.cs
- Parser.cs
- ETagAttribute.cs
- UrlMappingsModule.cs
- ResizeGrip.cs
- TreeNodeCollectionEditor.cs
- BinaryMethodMessage.cs
- CreateUserErrorEventArgs.cs
- ObjectQueryProvider.cs
- TypeDelegator.cs
- WebPart.cs
- Application.cs
- DefaultSection.cs
- MediaContextNotificationWindow.cs
- SeekableReadStream.cs
- BitmapEffectState.cs
- ClientUrlResolverWrapper.cs
- TypeDescriptor.cs
- SafeViewOfFileHandle.cs
- InvalidComObjectException.cs
- CryptoStream.cs
- BitmapEffectDrawing.cs
- ProviderSettingsCollection.cs
- StylusPoint.cs
- ping.cs
- DashStyles.cs
- QuadraticEase.cs
- IsolatedStorage.cs
- ObjectListDataBindEventArgs.cs
- FilterEventArgs.cs
- ping.cs
- HtmlContainerControl.cs
- ColorMatrix.cs
- SimpleLine.cs
- DataView.cs
- SplineQuaternionKeyFrame.cs
- cookiecontainer.cs
- PreloadedPackages.cs
- MaterializeFromAtom.cs
- StateRuntime.cs
- WorkflowInstanceQuery.cs
- CorePropertiesFilter.cs
- HtmlSelect.cs
- WindowsStreamSecurityElement.cs
- GridViewEditEventArgs.cs
- ItemChangedEventArgs.cs
- MatrixAnimationUsingPath.cs
- TranslateTransform3D.cs
- ViewCellRelation.cs
- CompiledAction.cs
- LexicalChunk.cs
- OleDbConnectionInternal.cs
- DataRecordObjectView.cs
- CqlParserHelpers.cs
- IResourceProvider.cs
- MenuCommand.cs
- TraceHwndHost.cs
- HttpModulesSection.cs
- IList.cs
- ConfigsHelper.cs
- CollectionBuilder.cs
- TableParagraph.cs
- ImportCatalogPart.cs
- ValueTypePropertyReference.cs
- Decoder.cs
- _HelperAsyncResults.cs
- SoapReflectionImporter.cs
- SafeNativeMethods.cs
- InvalidAsynchronousStateException.cs
- RegionData.cs
- SoapConverter.cs
- SystemIcmpV4Statistics.cs
- WaitHandle.cs
- ComponentResourceManager.cs
- SkipQueryOptionExpression.cs
- hebrewshape.cs
- AjaxFrameworkAssemblyAttribute.cs
- CaseInsensitiveHashCodeProvider.cs