private Type EventTypeToType(EventParameterType type) { switch (type) { case EventParameterType.Boolean: return(typeof(bool)); case EventParameterType.Byte: return(typeof(byte)); case EventParameterType.SByte: return(typeof(sbyte)); case EventParameterType.Char: return(typeof(char)); case EventParameterType.Int16: return(typeof(short)); case EventParameterType.UInt16: return(typeof(ushort)); case EventParameterType.Int32: return(typeof(int)); case EventParameterType.UInt32: return(typeof(uint)); case EventParameterType.Int64: return(typeof(long)); case EventParameterType.UInt64: return(typeof(ulong)); case EventParameterType.IntPtr: return(typeof(IntPtr)); case EventParameterType.Single: return(typeof(float)); case EventParameterType.Double: return(typeof(double)); case EventParameterType.Decimal: return(typeof(decimal)); case EventParameterType.Guid: return(typeof(Guid)); case EventParameterType.String: return(typeof(string)); default: // TODO: should I throw an exception here? return(null); } }
/// <summary> /// Method for getting for example: /// - the index of the second parameter with the type kgfstring /// </summary> /// <param name="theIndex"></param> /// <param name="theType"></param> /// <returns></returns> int GetParameterIndexWithType(int theIndex, string theType) { int anIndex = 0; for (int i = 0; i < itsParameterTypes.Length; i++) { EventParameterType aParameterType = itsParameterTypes[i]; if (aParameterType.itsTypeName == theType) { if (anIndex == theIndex) { return(i); } anIndex++; } } return(0); }
public EventDescriptor(ushort id, byte version, byte channel, byte level, byte opcode, ushort task, ulong keyword, string message, EventParameterType[] parameterTypes) : this() { Descriptor.Id = id; Descriptor.Version = version; Descriptor.Channel = channel; Descriptor.Level = level; Descriptor.Opcode = opcode; Descriptor.Task = task; Descriptor.Keyword = keyword; Message = message; ParameterTypes = parameterTypes; }
private Type EventTypeToType(EventParameterType type) { switch (type) { case EventParameterType.Boolean: return typeof(bool); case EventParameterType.Byte: return typeof(byte); case EventParameterType.SByte: return typeof(sbyte); case EventParameterType.Char: return typeof(char); case EventParameterType.Int16: return typeof(short); case EventParameterType.UInt16: return typeof(ushort); case EventParameterType.Int32: return typeof(int); case EventParameterType.UInt32: return typeof(uint); case EventParameterType.Int64: return typeof(long); case EventParameterType.UInt64: return typeof(ulong); case EventParameterType.IntPtr: return typeof(IntPtr); case EventParameterType.Single: return typeof(float); case EventParameterType.Double: return typeof(double); case EventParameterType.Decimal: return typeof(decimal); case EventParameterType.Guid: return typeof(Guid); case EventParameterType.String: return typeof(string); default: // TODO: should I throw an exception here? return null; } }
public EventMetadata(EventDescriptor descriptor, EventTags tags, bool enabledForAnyListener, bool enabledForETW, string name, string message, EventParameterType[] parameterTypes) { this.Descriptor = descriptor; this.Tags = tags; this.EnabledForAnyListener = enabledForAnyListener; this.EnabledForETW = enabledForETW; this.TriggersActivityTracking = 0; this.Name = name; this.Message = message; this.Parameters = null; this.TraceLoggingEventTypes = null; this.ActivityOptions = EventActivityOptions.None; this.ParameterTypes = parameterTypes; this.HasRelatedActivityID = false; }
public EventParameter this[EventParameterType type] { get { return(Im.Find((EventParameter eventParameter) => eventParameter.Type == type, Parameters)); } }
public bool Has(EventParameterType type) { return(this[type] != null); }