public PropertyAnalysis(string name, MethodInfo getterInfo, TraceLoggingTypeInfo typeInfo, EventFieldAttribute fieldAttribute) { this.name = name; this.getterInfo = getterInfo; this.typeInfo = typeInfo; this.fieldAttribute = fieldAttribute; }
// Token: 0x06003526 RID: 13606 RVA: 0x000CE2FC File Offset: 0x000CC4FC public override void WriteMetadata(TraceLoggingMetadataCollector collector, string name, EventFieldFormat format) { TraceLoggingMetadataCollector traceLoggingMetadataCollector = collector.AddGroup(name); if (this.properties != null) { foreach (PropertyAnalysis propertyAnalysis in this.properties) { EventFieldFormat format2 = EventFieldFormat.Default; EventFieldAttribute fieldAttribute = propertyAnalysis.fieldAttribute; if (fieldAttribute != null) { traceLoggingMetadataCollector.Tags = fieldAttribute.Tags; format2 = fieldAttribute.Format; } propertyAnalysis.typeInfo.WriteMetadata(traceLoggingMetadataCollector, propertyAnalysis.name, format2); } } }
public TypeAnalysis(Type dataType, EventDataAttribute eventAttrib, List <Type> recursionCheck) { IEnumerable <PropertyInfo> properties = Statics.GetProperties(dataType); List <PropertyAnalysis> propertyAnalysisList = new List <PropertyAnalysis>(); foreach (PropertyInfo propInfo in properties) { if (!Statics.HasCustomAttribute(propInfo, typeof(EventIgnoreAttribute)) && propInfo.CanRead && propInfo.GetIndexParameters().Length == 0) { MethodInfo getMethod = Statics.GetGetMethod(propInfo); if (!(getMethod == (MethodInfo)null) && !getMethod.IsStatic && getMethod.IsPublic) { TraceLoggingTypeInfo typeInfoInstance = Statics.GetTypeInfoInstance(propInfo.PropertyType, recursionCheck); EventFieldAttribute customAttribute = Statics.GetCustomAttribute <EventFieldAttribute>(propInfo); string name = customAttribute == null || customAttribute.Name == null ? (Statics.ShouldOverrideFieldName(propInfo.Name) ? typeInfoInstance.Name : propInfo.Name) : customAttribute.Name; propertyAnalysisList.Add(new PropertyAnalysis(name, getMethod, typeInfoInstance, customAttribute)); } } } this.properties = propertyAnalysisList.ToArray(); foreach (PropertyAnalysis property in this.properties) { TraceLoggingTypeInfo traceLoggingTypeInfo = property.typeInfo; this.level = (EventLevel)Statics.Combine((int)traceLoggingTypeInfo.Level, (int)this.level); this.opcode = (EventOpcode)Statics.Combine((int)traceLoggingTypeInfo.Opcode, (int)this.opcode); this.keywords = this.keywords | traceLoggingTypeInfo.Keywords; this.tags = this.tags | traceLoggingTypeInfo.Tags; } if (eventAttrib != null) { this.level = (EventLevel)Statics.Combine((int)eventAttrib.Level, (int)this.level); this.opcode = (EventOpcode)Statics.Combine((int)eventAttrib.Opcode, (int)this.opcode); this.keywords = this.keywords | eventAttrib.Keywords; this.tags = this.tags | eventAttrib.Tags; this.name = eventAttrib.Name; } if (this.name != null) { return; } this.name = dataType.Name; }
public override void WriteMetadata(TraceLoggingMetadataCollector collector, string name, EventFieldFormat format) { TraceLoggingMetadataCollector collector1 = collector.AddGroup(name); if (this.properties == null) { return; } foreach (PropertyAnalysis property in this.properties) { EventFieldFormat format1 = EventFieldFormat.Default; EventFieldAttribute eventFieldAttribute = property.fieldAttribute; if (eventFieldAttribute != null) { collector1.Tags = eventFieldAttribute.Tags; format1 = eventFieldAttribute.Format; } property.typeInfo.WriteMetadata(collector1, property.name, format1); } }