public void UsingEnumArguments(MyLongEnum arg1, MyIntEnum arg2) { if (IsEnabled()) { WriteEvent(305, arg1, arg2); } }
public void UsingEnumArguments(MyLongEnum arg1, MyIntEnum arg2, MyShortEnum arg3) { if (IsEnabled()) { WriteEvent(306, arg1, arg2, arg3); } }
public void UsingAllEnumArguments(MyLongEnum arg1, MyIntEnum arg2, MyShortEnum arg3, MyByteEnum arg4, MySByteEnum arg5, MyUShortEnum arg6, MyUIntEnum arg7, MyULongEnum arg8) { if (IsEnabled()) { WriteEvent(307, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8); } }
public void EventWithXferWeirdArgs(Guid RelatedActivityId, IntPtr iptr, bool b, MyLongEnum le /*, decimal dec */) { unsafe { EventSource.EventData *descrs = stackalloc EventSource.EventData[4]; descrs[0].DataPointer = (IntPtr)(&iptr); descrs[0].Size = IntPtr.Size; int boolval = b ? 1 : 0; descrs[1].DataPointer = (IntPtr)(&boolval); descrs[1].Size = 4; descrs[2].DataPointer = (IntPtr)(&le); descrs[2].Size = 8; // descrs[3].DataPointer = (IntPtr)(&dec); // descrs[3].Size = 16; WriteEventWithRelatedActivityIdCore(31, &RelatedActivityId, 3 /*4*/, descrs); } }
// 4.5 EventSource does not support IntPtr args public void EventWithWeirdArgs(IntPtr iptr, bool b, MyLongEnum le /*, decimal dec*/) { WriteEvent(30, iptr, b, le /*, dec*/); }
public void EventWithXferWeirdArgs(Guid RelatedActivityId, IntPtr iptr, bool b, MyLongEnum le /*, decimal dec */) { unsafe { EventSource.EventData* descrs = stackalloc EventSource.EventData[4]; descrs[0].DataPointer = (IntPtr)(&iptr); descrs[0].Size = IntPtr.Size; int boolval = b ? 1 : 0; descrs[1].DataPointer = (IntPtr)(&boolval); descrs[1].Size = 4; descrs[2].DataPointer = (IntPtr)(&le); descrs[2].Size = 8; // descrs[3].DataPointer = (IntPtr)(&dec); // descrs[3].Size = 16; WriteEventWithRelatedActivityIdCore(31, &RelatedActivityId, 3 /*4*/, descrs); } }
public MyClassWithEnumMembers(int value) { _myByteEnum = (MyByteEnum) value; _mySByteEnum = (MySByteEnum) value; _myShortEnum = (MyShortEnum) value; _myUShortEnum = (MyUShortEnum) value; _myIntEnum = (MyIntEnum) value; _myUIntEnum = (MyUIntEnum) value; _myLongEnum = (MyLongEnum) value; _myULongEnum = (MyULongEnum) value; }