public override void WriteData(TraceLoggingDataCollector collector, ref DateTimeOffset value) { var ticks = value.Ticks; collector.AddScalar(ticks < 504911232000000000 ? 0 : ticks - 504911232000000000); collector.AddScalar(value.Offset.Ticks); }
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value) { var dateTimeOffset = value.ScalarValue.AsDateTimeOffset; var ticks = dateTimeOffset.Ticks; collector.AddScalar(ticks < 504911232000000000 ? 0 : ticks - 504911232000000000); collector.AddScalar(dateTimeOffset.Offset.Ticks); }
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value) { var hasValue = hasValueGetter(value); collector.AddScalar(hasValue); var val = hasValue.ScalarValue.AsBoolean ? valueGetter(value) : valueInfo.PropertyValueFactory(Activator.CreateInstance(valueInfo.DataType)); this.valueInfo.WriteData(collector, val); }
public override void WriteData(PropertyValue value) { object?refVal = value.ReferenceValue; bool hasValue = refVal is not null; TraceLoggingDataCollector.AddScalar(hasValue); PropertyValue val = valueInfo.PropertyValueFactory(hasValue ? refVal #if ES_BUILD_STANDALONE : FormatterServices.GetUninitializedObject(valueInfo.DataType));
public override void WriteData( TraceLoggingDataCollector collector, ref Nullable <T> value) { var hasValue = value.HasValue; collector.AddScalar(hasValue); var val = hasValue ? value.Value : default(T); this.valueInfo.WriteData(collector, ref val); }
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value) { // It's not currently possible to get the HasValue property of a nullable type through reflection when the // value is null. Instead, we simply check that the nullable is not null. bool hasValue = value.ReferenceValue != null; collector.AddScalar(hasValue); PropertyValue val = hasValue ? valueGetter(value) : valueInfo.PropertyValueFactory(Activator.CreateInstance(valueInfo.DataType)); this.valueInfo.WriteData(collector, val); }
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value) { DateTime dateTime = value.ScalarValue.AsDateTime; const long UTCMinTicks = 504911232000000000; long dateTimeTicks = 0; // We cannot translate dates sooner than 1/1/1601 in UTC. // To avoid getting an ArgumentOutOfRangeException we compare with 1/1/1601 DateTime ticks if (dateTime.Ticks > UTCMinTicks) { dateTimeTicks = dateTime.ToFileTimeUtc(); } collector.AddScalar(dateTimeTicks); }
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value) { collector.AddScalar(value); }
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value) { collector.AddScalar((double)value.ScalarValue.AsDecimal); }
public override void WriteData(TraceLoggingDataCollector collector, ref EnumType value) { collector.AddScalar(EnumHelper <sbyte> .Cast <EnumType>(value)); }
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value) { collector.AddScalar(value); }
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value) { var hasValue = hasValueGetter(value); collector.AddScalar(hasValue); var val = hasValue.ScalarValue.AsBoolean ? valueGetter(value) : valueInfo.PropertyValueFactory(Activator.CreateInstance(valueInfo.DataType)); this.valueInfo.WriteData(collector, val); }
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value) { collector.AddScalar((double)value.ScalarValue.AsDecimal); }
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value) { collector.AddScalar(value.ScalarValue.AsTimeSpan.Ticks); }
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value) { var dateTimeOffset = value.ScalarValue.AsDateTimeOffset; var ticks = dateTimeOffset.Ticks; collector.AddScalar(ticks < 504911232000000000 ? 0 : ticks - 504911232000000000); collector.AddScalar(dateTimeOffset.Offset.Ticks); }
public override void WriteData(TraceLoggingDataCollector collector, ref TimeSpan value) { collector.AddScalar(value.Ticks); }
public override void WriteData(TraceLoggingDataCollector collector, ref Decimal value) { collector.AddScalar((double)value); }
public override void WriteData(TraceLoggingDataCollector collector, PropertyValue value) { collector.AddScalar(value.ScalarValue.AsTimeSpan.Ticks); }
public override void WriteData(TraceLoggingDataCollector collector, ref int value) { collector.AddScalar(value); }
public override void WriteData(TraceLoggingDataCollector collector, ref DateTime value) { long ticks = value.Ticks; collector.AddScalar(ticks < 504911232000000000L ? 0L : ticks - 504911232000000000L); }