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
- TypeAccessException.cs
- TagPrefixInfo.cs
- ClrPerspective.cs
- CompleteWizardStep.cs
- TableCellCollection.cs
- FixedTextContainer.cs
- PersistenceTypeAttribute.cs
- SplitterPanel.cs
- Hash.cs
- BufferAllocator.cs
- XmlSchemaAll.cs
- InkCanvasAutomationPeer.cs
- BindUriHelper.cs
- XmlFormatWriterGenerator.cs
- GlyphRunDrawing.cs
- SqlBooleanMismatchVisitor.cs
- XmlIlTypeHelper.cs
- FontWeight.cs
- HttpHandlerActionCollection.cs
- CreateWorkflowOwnerCommand.cs
- PathFigure.cs
- BypassElementCollection.cs
- wmiprovider.cs
- Light.cs
- DataColumn.cs
- Zone.cs
- RuntimeArgumentHandle.cs
- InvalidateEvent.cs
- Interfaces.cs
- BuildResultCache.cs
- HtmlControlPersistable.cs
- SqlDataSourceConnectionPanel.cs
- DateTimeValueSerializer.cs
- ProfileSettingsCollection.cs
- LocalTransaction.cs
- GraphicsContainer.cs
- WebDisplayNameAttribute.cs
- CommonRemoteMemoryBlock.cs
- DynamicQueryableWrapper.cs
- SynchronizationContext.cs
- AssemblySettingAttributes.cs
- GeneralTransformCollection.cs
- DataGridViewCheckBoxCell.cs
- SamlSerializer.cs
- ProjectedSlot.cs
- OleDbWrapper.cs
- TcpChannelFactory.cs
- PasswordTextNavigator.cs
- HtmlTableRow.cs
- HtmlTableCellCollection.cs
- EmptyStringExpandableObjectConverter.cs
- SharedUtils.cs
- DropShadowBitmapEffect.cs
- ToolboxCategoryItems.cs
- XmlSchemaExternal.cs
- QuadraticBezierSegment.cs
- SqlDataSourceView.cs
- HttpModuleActionCollection.cs
- BmpBitmapDecoder.cs
- SourceSwitch.cs
- XmlDocumentType.cs
- TraceSwitch.cs
- LongCountAggregationOperator.cs
- FilteredReadOnlyMetadataCollection.cs
- Geometry3D.cs
- TransformDescriptor.cs
- RequiredFieldValidator.cs
- AlignmentYValidation.cs
- HtmlMeta.cs
- WorkflowApplicationException.cs
- Cloud.cs
- MailAddressCollection.cs
- ClientConfigurationHost.cs
- HttpDictionary.cs
- SqlNamer.cs
- HtmlControlPersistable.cs
- PropertyAccessVisitor.cs
- SystemKeyConverter.cs
- XmlNodeReader.cs
- ControlBuilderAttribute.cs
- RuleSet.cs
- XmlHierarchicalDataSourceView.cs
- VectorAnimationBase.cs
- ColumnWidthChangedEvent.cs
- RelationshipConstraintValidator.cs
- ConstraintStruct.cs
- CodeMemberEvent.cs
- SemaphoreSlim.cs
- ParameterElementCollection.cs
- Stack.cs
- IResourceProvider.cs
- TextContainer.cs
- TableProviderWrapper.cs
- RemotingClientProxy.cs
- X500Name.cs
- LocatorGroup.cs
- UInt16.cs
- ListBoxItemWrapperAutomationPeer.cs
- CustomWebEventKey.cs
- AspCompat.cs