当前位置: 首页>>代码示例>>C#>>正文


C# ComponentModel.EventDescriptor类代码示例

本文整理汇总了C#中System.ComponentModel.EventDescriptor的典型用法代码示例。如果您正苦于以下问题:C# EventDescriptor类的具体用法?C# EventDescriptor怎么用?C# EventDescriptor使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


EventDescriptor类属于System.ComponentModel命名空间,在下文中一共展示了EventDescriptor类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DataItemEventDescriptor

    internal DataItemEventDescriptor(
      DataItemTypeDescriptor owner,
      EventDescriptor parent,
      Type componentType,
      Type eventType,
      Action<object, object> addHandler,
      Action<object, object> removeHandler )
      : base( owner, parent )
    {
      if( componentType == null )
        throw new ArgumentNullException( "componentType" );

      if( eventType == null )
        throw new ArgumentNullException( "eventType" );

      if( addHandler == null )
        throw new ArgumentNullException( "addHandler" );

      if( removeHandler == null )
        throw new ArgumentNullException( "removeHandler" );

      m_componentType = componentType;
      m_eventType = eventType;
      m_addHandler = addHandler;
      m_removeHandler = removeHandler;
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:26,代码来源:DataItemEventDescriptor.cs

示例2: Add

    public int Add(EventDescriptor value)
    {
      Contract.Ensures(0 <= Contract.Result<int>());
      Contract.Ensures(Contract.Result<int>() <= 2147483646);

      return default(int);
    }
开发者ID:asvishnyakov,项目名称:CodeContracts,代码行数:7,代码来源:System.ComponentModel.EventDescriptorCollection.cs

示例3: GetCompatibleMethods

		protected override ICollection GetCompatibleMethods(EventDescriptor e)
		{
			ITypeDefinition definition = loader.GetPrimaryTypeDefinition();
			ArrayList compatibleMethods = new ArrayList();
			MethodInfo methodInfo = e.EventType.GetMethod("Invoke");
			var methodInfoParameters = methodInfo.GetParameters();
			
			foreach (IMethod method in definition.Methods) {
				if (method.Parameters.Count == methodInfoParameters.Length) {
					bool found = true;
					for (int i = 0; i < methodInfoParameters.Length; ++i) {
						ParameterInfo pInfo = methodInfoParameters[i];
						IParameter p = method.Parameters[i];
						if (p.Type.ReflectionName != pInfo.ParameterType.ToString()) {
							found = false;
							break;
						}
					}
					if (found) {
						compatibleMethods.Add(method.Name);
					}
				}
			}
			
			return compatibleMethods;
		}
开发者ID:dgrunwald,项目名称:SharpDevelop,代码行数:26,代码来源:CSharpEventBindingService.cs

示例4: ArgumentNullException

 ICollection IEventBindingService.GetCompatibleMethods(EventDescriptor e)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     return this.GetCompatibleMethods(e);
 }
开发者ID:Reegenerator,项目名称:Sample-CustomizeDatasetCS,代码行数:8,代码来源:EventBindingService.cs

示例5: ShowCode

		protected override bool ShowCode(IComponent component, EventDescriptor edesc, string methodName)
		{
			if (formDesigner != null) {
				formDesigner.ShowSourceCode(component, edesc, methodName);
				return true;
			}
			return false;
		}
开发者ID:Bombadil77,项目名称:SharpDevelop,代码行数:8,代码来源:EventBindingService.cs

示例6: DataItemEventDescriptorBase

    protected DataItemEventDescriptorBase( DataItemTypeDescriptor owner, EventDescriptor parent )
      : base( parent )
    {
      if( owner == null )
        throw new ArgumentNullException( "owner" );

      m_owner = owner;
    }
开发者ID:austinedeveloper,项目名称:WpfExtendedToolkit,代码行数:8,代码来源:DataItemEventDescriptorBase.cs

示例7: ArgumentNullException

		string IEventBindingService.CreateUniqueMethodName (IComponent component, EventDescriptor eventDescriptor)
		{
			if (eventDescriptor == null)
				throw new ArgumentNullException ("eventDescriptor");
			if (component == null)
				throw new ArgumentNullException ("component");

			return this.CreateUniqueMethodName (component, eventDescriptor);
		}
开发者ID:Profit0004,项目名称:mono,代码行数:9,代码来源:EventBindingService.cs

示例8: ReflectionEventDescriptor

		public ReflectionEventDescriptor (Type componentType, EventDescriptor oldEventDescriptor, Attribute[] attrs) : base (oldEventDescriptor, attrs)
		{
			_componentType = componentType;
			_eventType = oldEventDescriptor.EventType;

			EventInfo event_info = componentType.GetEvent (oldEventDescriptor.Name);
			add_method = event_info.GetAddMethod ();
			remove_method = event_info.GetRemoveMethod ();
		}
开发者ID:nlhepler,项目名称:mono,代码行数:9,代码来源:ReflectionEventDescriptor.cs

示例9: EventDescriptorCollection

		EventDescriptorCollection (EventDescriptor[] events, bool readOnly) 
		{
			this.isReadOnly = readOnly;
			if (events == null)
				return;

			for (int i = 0; i < events.Length; i++)
				this.Add (events[i]);
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:9,代码来源:EventDescriptorCollection.cs

示例10: CreateUniqueMethodName

		public string CreateUniqueMethodName (IComponent component, EventDescriptor e)
		{
			if (component.Site == null || component.Site.Name == null)
				throw new ArgumentException ("IComponent must be sited and named");
			
			//TODO: check component.Site.Name is valid as start of method name
			string trialPrefix = component.Site.Name + "_" + e.Name;
			
			return proxy.GenerateIdentifierUniqueInCodeBehind (trialPrefix);
		}
开发者ID:segaman,项目名称:monodevelop,代码行数:10,代码来源:EventBindingService.cs

示例11: Add

 public int Add(EventDescriptor value)
 {
     if (this.readOnly)
     {
         throw new NotSupportedException();
     }
     this.EnsureSize(this.eventCount + 1);
     this.events[this.eventCount++] = value;
     return (this.eventCount - 1);
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:EventDescriptorCollection.cs

示例12: GetEventDescriptorHashCode

 private string GetEventDescriptorHashCode(EventDescriptor eventDesc)
 {
     StringBuilder builder = new StringBuilder(eventDesc.Name);
     builder.Append(eventDesc.EventType.GetHashCode().ToString(CultureInfo.InvariantCulture));
     foreach (Attribute attribute in eventDesc.Attributes)
     {
         builder.Append(attribute.GetHashCode().ToString(CultureInfo.InvariantCulture));
     }
     return builder.ToString();
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:10,代码来源:EventBindingService.cs

示例13: EventDescriptorCollection

	// Constructors.
	public EventDescriptorCollection(EventDescriptor[] events)
			{
				list = new ArrayList();
				if(events != null)
				{
					foreach(EventDescriptor descr in events)
					{
						list.Add(descr);
					}
				}
			}
开发者ID:jjenki11,项目名称:blaze-chem-rendering,代码行数:12,代码来源:EventDescriptorCollection.cs

示例14: EventDescriptorCollection

 /// <devdoc>
 ///    <para>
 ///       Initializes a new instance of the <see cref='System.ComponentModel.EventDescriptorCollection'/> class.
 ///    </para>
 /// </devdoc>
 public EventDescriptorCollection(EventDescriptor[] events) {
     this.events = events;
     if (events == null) {
         this.events = new EventDescriptor[0];
         this.eventCount = 0;
     }
     else {
         this.eventCount = this.events.Length;
     }
     this.eventsOwned = true;
 }
开发者ID:REALTOBIZ,项目名称:mono,代码行数:16,代码来源:EventDescriptorCollection.cs

示例15: EventPropertyDescriptor

        public EventPropertyDescriptor(EventDescriptor eventDesc, IServiceProvider serviceProvider)
            : base(eventDesc)
        {
            _eventDescriptor = eventDesc;
            _serviceProvider = serviceProvider;

            FieldInfo eventFieldInfo = _eventDescriptor.ComponentType.GetField(_eventDescriptor.Name + "Event");
            if (eventFieldInfo != null)
            {
                _eventProperty = eventFieldInfo.GetValue(_eventDescriptor.ComponentType) as DependencyProperty;
            }
        }
开发者ID:ssickles,项目名称:archive,代码行数:12,代码来源:EventPropertyDescriptor.cs


注:本文中的System.ComponentModel.EventDescriptor类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。