74 instantiations of Value
Microsoft.Private.Windows.Core (74)
System\Value.cs (74)
106
public static implicit operator Value(byte value) =>
new
(value);
108
public static implicit operator Value(byte? value) =>
new
(value);
132
public static implicit operator Value(sbyte value) =>
new
(value);
134
public static implicit operator Value(sbyte? value) =>
new
(value);
158
public static implicit operator Value(bool value) =>
new
(value);
160
public static implicit operator Value(bool? value) =>
new
(value);
184
public static implicit operator Value(char value) =>
new
(value);
186
public static implicit operator Value(char? value) =>
new
(value);
210
public static implicit operator Value(short value) =>
new
(value);
212
public static implicit operator Value(short? value) =>
new
(value);
236
public static implicit operator Value(int value) =>
new
(value);
238
public static implicit operator Value(int? value) =>
new
(value);
262
public static implicit operator Value(long value) =>
new
(value);
264
public static implicit operator Value(long? value) =>
new
(value);
288
public static implicit operator Value(ushort value) =>
new
(value);
290
public static implicit operator Value(ushort? value) =>
new
(value);
314
public static implicit operator Value(uint value) =>
new
(value);
316
public static implicit operator Value(uint? value) =>
new
(value);
340
public static implicit operator Value(ulong value) =>
new
(value);
342
public static implicit operator Value(ulong? value) =>
new
(value);
366
public static implicit operator Value(float value) =>
new
(value);
368
public static implicit operator Value(float? value) =>
new
(value);
392
public static implicit operator Value(double value) =>
new
(value);
394
public static implicit operator Value(double? value) =>
new
(value);
418
public static implicit operator Value(Size value) =>
new
(value);
420
public static implicit operator Value(Size? value) =>
new
(value);
444
public static implicit operator Value(Point value) =>
new
(value);
446
public static implicit operator Value(Point? value) =>
new
(value);
473
this =
new
(value.Value);
477
public static implicit operator Value(Color value) =>
new
(value);
479
public static implicit operator Value(Color? value) =>
new
(value);
512
this =
new
(value.Value);
516
public static implicit operator Value(DateTimeOffset value) =>
new
(value);
518
public static implicit operator Value(DateTimeOffset? value) =>
new
(value);
542
public static implicit operator Value(DateTime value) =>
new
(value);
544
public static implicit operator Value(DateTime? value) =>
new
(value);
565
public static implicit operator Value(ArraySegment<byte> value) =>
new
(value);
584
public static implicit operator Value(ArraySegment<char> value) =>
new
(value);
589
public static implicit operator Value(decimal value) =>
new
(value);
591
public static implicit operator Value(decimal? value) => value.HasValue ?
new
(value.Value) :
new
(value);
604
return
new
(Unsafe.As<T, bool>(ref Unsafe.AsRef(in value)));
606
return
new
(Unsafe.As<T, byte>(ref Unsafe.AsRef(in value)));
608
return
new
(Unsafe.As<T, sbyte>(ref Unsafe.AsRef(in value)));
610
return
new
(Unsafe.As<T, char>(ref Unsafe.AsRef(in value)));
612
return
new
(Unsafe.As<T, short>(ref Unsafe.AsRef(in value)));
614
return
new
(Unsafe.As<T, int>(ref Unsafe.AsRef(in value)));
616
return
new
(Unsafe.As<T, long>(ref Unsafe.AsRef(in value)));
618
return
new
(Unsafe.As<T, ushort>(ref Unsafe.AsRef(in value)));
620
return
new
(Unsafe.As<T, uint>(ref Unsafe.AsRef(in value)));
622
return
new
(Unsafe.As<T, ulong>(ref Unsafe.AsRef(in value)));
624
return
new
(Unsafe.As<T, float>(ref Unsafe.AsRef(in value)));
626
return
new
(Unsafe.As<T, double>(ref Unsafe.AsRef(in value)));
628
return
new
(Unsafe.As<T, DateTime>(ref Unsafe.AsRef(in value)));
630
return
new
(Unsafe.As<T, DateTimeOffset>(ref Unsafe.AsRef(in value)));
632
return
new
(Unsafe.As<T, Color>(ref Unsafe.AsRef(in value)));
635
return
new
(Unsafe.As<T, bool?>(ref Unsafe.AsRef(in value)));
637
return
new
(Unsafe.As<T, byte?>(ref Unsafe.AsRef(in value)));
639
return
new
(Unsafe.As<T, sbyte?>(ref Unsafe.AsRef(in value)));
641
return
new
(Unsafe.As<T, char?>(ref Unsafe.AsRef(in value)));
643
return
new
(Unsafe.As<T, short?>(ref Unsafe.AsRef(in value)));
645
return
new
(Unsafe.As<T, int?>(ref Unsafe.AsRef(in value)));
647
return
new
(Unsafe.As<T, long?>(ref Unsafe.AsRef(in value)));
649
return
new
(Unsafe.As<T, ushort?>(ref Unsafe.AsRef(in value)));
651
return
new
(Unsafe.As<T, uint?>(ref Unsafe.AsRef(in value)));
653
return
new
(Unsafe.As<T, ulong?>(ref Unsafe.AsRef(in value)));
655
return
new
(Unsafe.As<T, float?>(ref Unsafe.AsRef(in value)));
657
return
new
(Unsafe.As<T, double?>(ref Unsafe.AsRef(in value)));
659
return
new
(Unsafe.As<T, DateTime?>(ref Unsafe.AsRef(in value)));
661
return
new
(Unsafe.As<T, DateTimeOffset?>(ref Unsafe.AsRef(in value)));
664
return
new
(Unsafe.As<T, ArraySegment<byte>>(ref Unsafe.AsRef(in value)));
666
return
new
(Unsafe.As<T, ArraySegment<char>>(ref Unsafe.AsRef(in value)));
671
return new
Value
(StraightCastFlag<T>.Instance, Unsafe.As<T, ulong>(ref value));
674
return new
Value
(value);
93 references to Value
Microsoft.Private.Windows.Core (93)
System\Value.cs (81)
24
/// Creates a new <see cref="
Value
"/> with the given <see langword="object"/>. To avoid boxing enums, use the
34
/// The <see cref="System.Type"/> of the value stored in this <see cref="
Value
"/>.
106
public static implicit operator
Value
(byte value) => new(value);
107
public static explicit operator byte(in
Value
value) => value.GetValue<byte>();
108
public static implicit operator
Value
(byte? value) => new(value);
109
public static explicit operator byte?(in
Value
value) => value.GetValue<byte?>();
132
public static implicit operator
Value
(sbyte value) => new(value);
133
public static explicit operator sbyte(in
Value
value) => value.GetValue<sbyte>();
134
public static implicit operator
Value
(sbyte? value) => new(value);
135
public static explicit operator sbyte?(in
Value
value) => value.GetValue<sbyte?>();
158
public static implicit operator
Value
(bool value) => new(value);
159
public static explicit operator bool(in
Value
value) => value.GetValue<bool>();
160
public static implicit operator
Value
(bool? value) => new(value);
161
public static explicit operator bool?(in
Value
value) => value.GetValue<bool?>();
184
public static implicit operator
Value
(char value) => new(value);
185
public static explicit operator char(in
Value
value) => value.GetValue<char>();
186
public static implicit operator
Value
(char? value) => new(value);
187
public static explicit operator char?(in
Value
value) => value.GetValue<char?>();
210
public static implicit operator
Value
(short value) => new(value);
211
public static explicit operator short(in
Value
value) => value.GetValue<short>();
212
public static implicit operator
Value
(short? value) => new(value);
213
public static explicit operator short?(in
Value
value) => value.GetValue<short?>();
236
public static implicit operator
Value
(int value) => new(value);
237
public static explicit operator int(in
Value
value) => value.GetValue<int>();
238
public static implicit operator
Value
(int? value) => new(value);
239
public static explicit operator int?(in
Value
value) => value.GetValue<int?>();
262
public static implicit operator
Value
(long value) => new(value);
263
public static explicit operator long(in
Value
value) => value.GetValue<long>();
264
public static implicit operator
Value
(long? value) => new(value);
265
public static explicit operator long?(in
Value
value) => value.GetValue<long?>();
288
public static implicit operator
Value
(ushort value) => new(value);
289
public static explicit operator ushort(in
Value
value) => value.GetValue<ushort>();
290
public static implicit operator
Value
(ushort? value) => new(value);
291
public static explicit operator ushort?(in
Value
value) => value.GetValue<ushort?>();
314
public static implicit operator
Value
(uint value) => new(value);
315
public static explicit operator uint(in
Value
value) => value.GetValue<uint>();
316
public static implicit operator
Value
(uint? value) => new(value);
317
public static explicit operator uint?(in
Value
value) => value.GetValue<uint?>();
340
public static implicit operator
Value
(ulong value) => new(value);
341
public static explicit operator ulong(in
Value
value) => value.GetValue<ulong>();
342
public static implicit operator
Value
(ulong? value) => new(value);
343
public static explicit operator ulong?(in
Value
value) => value.GetValue<ulong?>();
366
public static implicit operator
Value
(float value) => new(value);
367
public static explicit operator float(in
Value
value) => value.GetValue<float>();
368
public static implicit operator
Value
(float? value) => new(value);
369
public static explicit operator float?(in
Value
value) => value.GetValue<float?>();
392
public static implicit operator
Value
(double value) => new(value);
393
public static explicit operator double(in
Value
value) => value.GetValue<double>();
394
public static implicit operator
Value
(double? value) => new(value);
395
public static explicit operator double?(in
Value
value) => value.GetValue<double?>();
418
public static implicit operator
Value
(Size value) => new(value);
419
public static explicit operator Size(in
Value
value) => value.GetValue<Size>();
420
public static implicit operator
Value
(Size? value) => new(value);
421
public static explicit operator Size?(in
Value
value) => value.GetValue<Size?>();
444
public static implicit operator
Value
(Point value) => new(value);
445
public static explicit operator Point(in
Value
value) => value.GetValue<Point>();
446
public static implicit operator
Value
(Point? value) => new(value);
447
public static explicit operator Point?(in
Value
value) => value.GetValue<Point?>();
477
public static implicit operator
Value
(Color value) => new(value);
478
public static explicit operator Color(in
Value
value) => value.GetValue<Color>();
479
public static implicit operator
Value
(Color? value) => new(value);
480
public static explicit operator Color?(in
Value
value) => value.GetValue<Color?>();
516
public static implicit operator
Value
(DateTimeOffset value) => new(value);
517
public static explicit operator DateTimeOffset(in
Value
value) => value.GetValue<DateTimeOffset>();
518
public static implicit operator
Value
(DateTimeOffset? value) => new(value);
519
public static explicit operator DateTimeOffset?(in
Value
value) => value.GetValue<DateTimeOffset?>();
542
public static implicit operator
Value
(DateTime value) => new(value);
543
public static explicit operator DateTime(in
Value
value) => value.GetValue<DateTime>();
544
public static implicit operator
Value
(DateTime? value) => new(value);
545
public static explicit operator DateTime?(in
Value
value) => value.GetValue<DateTime?>();
565
public static implicit operator
Value
(ArraySegment<byte> value) => new(value);
566
public static explicit operator ArraySegment<byte>(in
Value
value) => value.GetValue<ArraySegment<byte>>();
584
public static implicit operator
Value
(ArraySegment<char> value) => new(value);
585
public static explicit operator ArraySegment<char>(in
Value
value) => value.GetValue<ArraySegment<char>>();
589
public static implicit operator
Value
(decimal value) => new(value);
590
public static explicit operator decimal(in
Value
value) => value.GetValue<decimal>();
591
public static implicit operator
Value
(decimal? value) => value.HasValue ? new(value.Value) : new(value);
592
public static explicit operator decimal?(in
Value
value) => value.GetValue<decimal?>();
598
/// Creates a new <see cref="
Value
"/> with the given value. This method can always be used and avoids boxing enums.
600
public static
Value
Create<T>(T value)
686
/// Tries to get the value stored in this <see cref="
Value
"/> as the given type. Returns <see langword="true"/> if
System\Value.PackedColorFlag.cs (1)
14
public override Color To(in
Value
value)
System\Value.PackedDateTimeOffsetFlag.cs (1)
12
public override DateTimeOffset To(in
Value
value) => value._union.PackedDateTimeOffset.Extract();
System\Value.StraightCastFlag.cs (1)
16
public override T To(in
Value
value) => Unsafe.As<Union, T>(ref Unsafe.AsRef(in value._union));
System\Value.TypeFlag.cs (6)
9
/// A flag that represents the <see cref="System.Type"/> of a <see cref="Union"/> in a <see cref="
Value
"/>.
10
/// Also provides the functionality to convert any <see cref="
Value
"/> to an <see langword="object"/> that
22
/// Converts the given <see cref="
Value
"/> to an <see langword="object"/>.
24
public abstract object ToObject(in
Value
value);
38
public override object ToObject(in
Value
value) => To(value)!;
39
public abstract T To(in
Value
value);
System\Value.Union.cs (2)
11
/// Data union for the <see cref="
Value
"/> type.
16
/// <see cref="
Value
"/> type.
System\Value.UtcDateTimeOffsetFlag.cs (1)
12
public override DateTimeOffset To(in
Value
value) => new(new DateTime(value._union.Ticks, DateTimeKind.Utc));