本文整理汇总了C#中dnlib.DotNet.EventDef类的典型用法代码示例。如果您正苦于以下问题:C# EventDef类的具体用法?C# EventDef怎么用?C# EventDef使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EventDef类属于dnlib.DotNet命名空间,在下文中一共展示了EventDef类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: FindBaseEvents
public static IEnumerable<EventDef> FindBaseEvents(EventDef eventDef)
{
if (eventDef == null)
yield break;
var eventType = eventDef.EventType.ToTypeSig();
foreach (var baseType in BaseTypes(eventDef.DeclaringType)) {
var baseTypeDef = baseType.Resolve();
if (baseTypeDef == null)
continue;
foreach (var baseEvent in baseTypeDef.Events) {
if (MatchEvent(baseEvent, Resolve(baseEvent.EventType.ToTypeSig(), baseType), eventDef, eventType) &&
IsVisibleFromDerived(baseEvent, eventDef.DeclaringType)) {
yield return baseEvent;
var anyEventAccessor = baseEvent.AddMethod ?? baseEvent.RemoveMethod;
if (anyEventAccessor != null && anyEventAccessor.IsNewSlot == anyEventAccessor.IsVirtual)
yield break;
}
}
}
}
开发者ID:lovebanyi,项目名称:dnSpy,代码行数:22,代码来源:TypesHierarchyHelpers.cs
示例17: NewEvent
public TreeNode NewEvent(EventDef @event)
{
TreeNode node = NewNode(String.Format("{0}: {1}", @event.Name, "EventHandler"));
node.Tag = @event;
node.ImageIndex = node.SelectedImageIndex = 15;
if (@event.AddMethod != null)
{
node.Nodes.Add(NewMethod(@event.AddMethod));
}
if (@event.RemoveMethod != null)
{
node.Nodes.Add(NewMethod(@event.RemoveMethod));
}
if (@event.InvokeMethod != null)
{
node.Nodes.Add(NewMethod(@event.InvokeMethod));
}
foreach (MethodDef method in @event.OtherMethods)
{
node.Nodes.Add(NewMethod(method));
}
return node;
}
开发者ID:peterdocter,项目名称:dnEditor,代码行数:29,代码来源:TreeViewHandler.cs
示例18: Search
void Search(IDnSpyFile ownerModule, TypeDef type, EventDef evt)
{
var res = options.Filter.GetResult(evt);
if (res.FilterType == FilterType.Hide)
return;
CheckCustomAttributes(ownerModule, evt, type);
if (res.IsMatch && IsMatch(evt.Name, evt)) {
options.OnMatch(new SearchResult {
Context = options.Context,
Object = evt,
NameObject = evt,
ObjectImageReference = options.DotNetImageManager.GetImageReference(evt),
LocationObject = type,
LocationImageReference = options.DotNetImageManager.GetImageReference(type),
DnSpyFile = ownerModule,
});
}
}
开发者ID:yueding,项目名称:dnSpy,代码行数:19,代码来源:FilterSearcher.cs
示例19: FindEventNode
/// <summary>
/// Looks up the event node corresponding to the event definition.
/// Returns null if no matching node is found.
/// </summary>
public EventTreeNode FindEventNode(EventDef def)
{
if (def == null)
return null;
TypeTreeNode typeNode = FindTypeNode(def.DeclaringType);
if (typeNode == null)
return null;
typeNode.EnsureChildrenFiltered();
return typeNode.Children.OfType<EventTreeNode>().FirstOrDefault(m => m.EventDefinition == def);
}
开发者ID:BahNahNah,项目名称:dnSpy,代码行数:14,代码来源:AssemblyListTreeNode.cs
示例20: CanShow
public static bool CanShow(EventDef ev) {
return GetBackingField(ev) != null;
}
开发者ID:arkanoid1,项目名称:dnSpy,代码行数:3,代码来源:AnalyzedEventFiredByTreeNode.cs
注:本文中的dnlib.DotNet.EventDef类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论