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


C# DotNet.EventDef类代码示例

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


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

示例1: AnalyzedEventTreeNode

		public AnalyzedEventTreeNode(EventDef analyzedEvent, bool hidesParent = false) {
			if (analyzedEvent == null)
				throw new ArgumentNullException("analyzedEvent");
			this.analyzedEvent = analyzedEvent;
			this.hidesParent = hidesParent;
			this.LazyLoading = true;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:7,代码来源:AnalyzedEventTreeNode.cs

示例2: AnalyzedEventOverridesTreeNode

        public AnalyzedEventOverridesTreeNode(EventDef analyzedEvent)
        {
            if (analyzedEvent == null)
                throw new ArgumentNullException("analyzedEvent");

            this.analyzedEvent = analyzedEvent;
        }
开发者ID:jorik041,项目名称:dnSpy-retired,代码行数:7,代码来源:AnalyzedEventOverridesTreeNode.cs

示例3: InterfaceEventImplementedByNode

		public InterfaceEventImplementedByNode(EventDef analyzedEvent) {
			if (analyzedEvent == null)
				throw new ArgumentNullException("analyzedEvent");

			this.analyzedEvent = analyzedEvent;
			this.analyzedMethod = this.analyzedEvent.AddMethod ?? this.analyzedEvent.RemoveMethod;
		}
开发者ID:levisre,项目名称:dnSpy,代码行数:7,代码来源:InterfaceEventImplementedByNode.cs

示例4: AnalyzedEventTreeNode

 public AnalyzedEventTreeNode(EventDef analyzedEvent, string prefix = "")
 {
     if (analyzedEvent == null)
         throw new ArgumentNullException("analyzedEvent");
     this.analyzedEvent = analyzedEvent;
     this.prefix = prefix;
     this.LazyLoading = true;
 }
开发者ID:jorik041,项目名称:dnSpy-retired,代码行数:8,代码来源:AnalyzedEventTreeNode.cs

示例5: DeletedEventUpdater

		public DeletedEventUpdater(ModuleDocumentNode modNode, EventDef originalEvent) {
			ownerNode = modNode.Context.DocumentTreeView.FindNode(originalEvent);
			if (ownerNode == null)
				throw new InvalidOperationException();
			parentNode = ownerNode.TreeNode.Parent.Data;
			ownerType = originalEvent.DeclaringType;
			@event = originalEvent;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:DeletedEventUpdater.cs

示例6: EditedEventUpdater

		public EditedEventUpdater(ModuleDocumentNode modNode, EventDef originalEvent, EventDefOptions eventDefOptions) {
			ownerNode = modNode.Context.DocumentTreeView.FindNode(originalEvent);
			if (ownerNode == null)
				throw new InvalidOperationException();
			@event = originalEvent;
			originalEventDefOptions = new EventDefOptions(originalEvent);
			newEventDefOptions = eventDefOptions;
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:8,代码来源:EditedEventUpdater.cs

示例7: Write

		public static ITextOutput Write(ITextOutput output, EventDef ev, Language language) {
			output.Write(UIUtils.CleanUpIdentifier(ev.Name), TextTokenHelper.GetTextTokenType(ev));
			output.WriteSpace();
			output.Write(':', TextTokenType.Operator);
			output.WriteSpace();
			language.TypeToString(output, ev.EventType, false, ev);
			ev.MDToken.WriteSuffixString(output);
			return output;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:9,代码来源:EventTreeNode.cs

示例8: EventDefOptions

		public EventDefOptions(EventDef evt) {
			this.Attributes = evt.Attributes;
			this.Name = evt.Name;
			this.EventType = evt.EventType;
			this.AddMethod = evt.AddMethod;
			this.InvokeMethod = evt.InvokeMethod;
			this.RemoveMethod = evt.RemoveMethod;
			this.OtherMethods.AddRange(evt.OtherMethods);
			this.CustomAttributes.AddRange(evt.CustomAttributes);
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:10,代码来源:EventDefOptions.cs

示例9: AnalyzedEventFiredByTreeNode

        public AnalyzedEventFiredByTreeNode(EventDef analyzedEvent)
        {
            if (analyzedEvent == null)
                throw new ArgumentNullException("analyzedEvent");

            this.analyzedEvent = analyzedEvent;

            this.eventBackingField = GetBackingField(analyzedEvent);
            this.eventFiringMethod = analyzedEvent.EventType.ResolveTypeDef().Methods.First(md => md.Name == "Invoke");
        }
开发者ID:jorik041,项目名称:dnSpy-retired,代码行数:10,代码来源:AnalyzedEventFiredByTreeNode.cs

示例10: EventDefOptions

		public EventDefOptions(EventDef evt) {
			Attributes = evt.Attributes;
			Name = evt.Name;
			EventType = evt.EventType;
			AddMethod = evt.AddMethod;
			InvokeMethod = evt.InvokeMethod;
			RemoveMethod = evt.RemoveMethod;
			OtherMethods.AddRange(evt.OtherMethods);
			CustomAttributes.AddRange(evt.CustomAttributes);
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:10,代码来源:EventDefOptions.cs

示例11: EventFiredByNode

		public EventFiredByNode(EventDef analyzedEvent) {
			if (analyzedEvent == null)
				throw new ArgumentNullException(nameof(analyzedEvent));

			this.analyzedEvent = analyzedEvent;

			eventBackingField = GetBackingField(analyzedEvent);
			var eventType = analyzedEvent.EventType.ResolveTypeDef();
			if (eventType != null)
				eventFiringMethod = eventType.Methods.First(md => md.Name == "Invoke");
		}
开发者ID:manojdjoshi,项目名称:dnSpy,代码行数:11,代码来源:EventFiredByNode.cs

示例12: CopyTo

		public EventDef CopyTo(EventDef evt) {
			evt.Attributes = this.Attributes;
			evt.Name = this.Name ?? UTF8String.Empty;
			evt.EventType = this.EventType;
			evt.AddMethod = this.AddMethod;
			evt.InvokeMethod = this.InvokeMethod;
			evt.RemoveMethod = this.RemoveMethod;
			evt.OtherMethods.Clear();
			evt.OtherMethods.AddRange(this.OtherMethods);
			evt.CustomAttributes.Clear();
			evt.CustomAttributes.AddRange(CustomAttributes);
			return evt;
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:13,代码来源:EventDefOptions.cs

示例13: EventTreeNode

		public EventTreeNode(EventDef ev) {
			if (ev == null)
				throw new ArgumentNullException("ev");
			this.ev = ev;

			if (ev.AddMethod != null)
				this.Children.Add(new MethodTreeNode(ev.AddMethod));
			if (ev.RemoveMethod != null)
				this.Children.Add(new MethodTreeNode(ev.RemoveMethod));
			if (ev.InvokeMethod != null)
				this.Children.Add(new MethodTreeNode(ev.InvokeMethod));
			if (ev.HasOtherMethods) {
				foreach (var m in ev.OtherMethods)
					this.Children.Add(new MethodTreeNode(m));
			}
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:16,代码来源:EventTreeNode.cs

示例14: GetMemberIcon

		static MemberIcon GetMemberIcon(EventDef eventDef) {
			MethodDef method = eventDef.AddMethod ?? eventDef.RemoveMethod;
			if (method == null)
				return MemberIcon.Event;

			var access = MethodTreeNode.GetMemberAccess(method);
			if (method.IsStatic) {
				switch (access) {
				case MemberAccess.Public: return MemberIcon.StaticEvent;
				case MemberAccess.Private: return MemberIcon.StaticEventPrivate;
				case MemberAccess.Protected: return MemberIcon.StaticEventProtected;
				case MemberAccess.Internal: return MemberIcon.StaticEventInternal;
				case MemberAccess.CompilerControlled: return MemberIcon.StaticEventCompilerControlled;
				case MemberAccess.ProtectedInternal: return MemberIcon.StaticEventProtectedInternal;
				default:
					Debug.Fail("Invalid MemberAccess");
					goto case MemberAccess.Public;
				}
			}

			if (method.IsVirtual) {
				switch (access) {
				case MemberAccess.Public: return MemberIcon.VirtualEvent;
				case MemberAccess.Private: return MemberIcon.VirtualEventPrivate;
				case MemberAccess.Protected: return MemberIcon.VirtualEventProtected;
				case MemberAccess.Internal: return MemberIcon.VirtualEventInternal;
				case MemberAccess.CompilerControlled: return MemberIcon.VirtualEventCompilerControlled;
				case MemberAccess.ProtectedInternal: return MemberIcon.VirtualEventProtectedInternal;
				default:
					Debug.Fail("Invalid MemberAccess");
					goto case MemberAccess.Public;
				}
			}

			switch (access) {
			case MemberAccess.Public: return MemberIcon.Event;
			case MemberAccess.Private: return MemberIcon.EventPrivate;
			case MemberAccess.Protected: return MemberIcon.EventProtected;
			case MemberAccess.Internal: return MemberIcon.EventInternal;
			case MemberAccess.CompilerControlled: return MemberIcon.EventCompilerControlled;
			case MemberAccess.ProtectedInternal: return MemberIcon.EventProtectedInternal;
			default:
				Debug.Fail("Invalid MemberAccess");
				goto case MemberAccess.Public;
			}
		}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:46,代码来源:EventTreeNode.cs

示例15: DecompileEvent

        public override void DecompileEvent(EventDef ev, ITextOutput output, DecompilationOptions options)
        {
            StartKeywordBlock(output, ".event", ev);

            if (ev.AddMethod != null) {
                StartKeywordBlock(output, ".add", ev.AddMethod);
                EndKeywordBlock(output);
            }

            if (ev.InvokeMethod != null) {
                StartKeywordBlock(output, ".invoke", ev.InvokeMethod);
                EndKeywordBlock(output);
            }

            if (ev.RemoveMethod != null) {
                StartKeywordBlock(output, ".remove", ev.RemoveMethod);
                EndKeywordBlock(output);
            }

            EndKeywordBlock(output);
        }
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:21,代码来源:ILAstLanguage.cs


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