當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。