74 instantiations of Value
Microsoft.Private.Windows.Core (74)
System\Value.cs (74)
106public static implicit operator Value(byte value) => new(value); 108public static implicit operator Value(byte? value) => new(value); 132public static implicit operator Value(sbyte value) => new(value); 134public static implicit operator Value(sbyte? value) => new(value); 158public static implicit operator Value(bool value) => new(value); 160public static implicit operator Value(bool? value) => new(value); 184public static implicit operator Value(char value) => new(value); 186public static implicit operator Value(char? value) => new(value); 210public static implicit operator Value(short value) => new(value); 212public static implicit operator Value(short? value) => new(value); 236public static implicit operator Value(int value) => new(value); 238public static implicit operator Value(int? value) => new(value); 262public static implicit operator Value(long value) => new(value); 264public static implicit operator Value(long? value) => new(value); 288public static implicit operator Value(ushort value) => new(value); 290public static implicit operator Value(ushort? value) => new(value); 314public static implicit operator Value(uint value) => new(value); 316public static implicit operator Value(uint? value) => new(value); 340public static implicit operator Value(ulong value) => new(value); 342public static implicit operator Value(ulong? value) => new(value); 366public static implicit operator Value(float value) => new(value); 368public static implicit operator Value(float? value) => new(value); 392public static implicit operator Value(double value) => new(value); 394public static implicit operator Value(double? value) => new(value); 418public static implicit operator Value(Size value) => new(value); 420public static implicit operator Value(Size? value) => new(value); 444public static implicit operator Value(Point value) => new(value); 446public static implicit operator Value(Point? value) => new(value); 473this = new(value.Value); 477public static implicit operator Value(Color value) => new(value); 479public static implicit operator Value(Color? value) => new(value); 512this = new(value.Value); 516public static implicit operator Value(DateTimeOffset value) => new(value); 518public static implicit operator Value(DateTimeOffset? value) => new(value); 542public static implicit operator Value(DateTime value) => new(value); 544public static implicit operator Value(DateTime? value) => new(value); 565public static implicit operator Value(ArraySegment<byte> value) => new(value); 584public static implicit operator Value(ArraySegment<char> value) => new(value); 589public static implicit operator Value(decimal value) => new(value); 591public static implicit operator Value(decimal? value) => value.HasValue ? new(value.Value) : new(value); 604return new(Unsafe.As<T, bool>(ref Unsafe.AsRef(in value))); 606return new(Unsafe.As<T, byte>(ref Unsafe.AsRef(in value))); 608return new(Unsafe.As<T, sbyte>(ref Unsafe.AsRef(in value))); 610return new(Unsafe.As<T, char>(ref Unsafe.AsRef(in value))); 612return new(Unsafe.As<T, short>(ref Unsafe.AsRef(in value))); 614return new(Unsafe.As<T, int>(ref Unsafe.AsRef(in value))); 616return new(Unsafe.As<T, long>(ref Unsafe.AsRef(in value))); 618return new(Unsafe.As<T, ushort>(ref Unsafe.AsRef(in value))); 620return new(Unsafe.As<T, uint>(ref Unsafe.AsRef(in value))); 622return new(Unsafe.As<T, ulong>(ref Unsafe.AsRef(in value))); 624return new(Unsafe.As<T, float>(ref Unsafe.AsRef(in value))); 626return new(Unsafe.As<T, double>(ref Unsafe.AsRef(in value))); 628return new(Unsafe.As<T, DateTime>(ref Unsafe.AsRef(in value))); 630return new(Unsafe.As<T, DateTimeOffset>(ref Unsafe.AsRef(in value))); 632return new(Unsafe.As<T, Color>(ref Unsafe.AsRef(in value))); 635return new(Unsafe.As<T, bool?>(ref Unsafe.AsRef(in value))); 637return new(Unsafe.As<T, byte?>(ref Unsafe.AsRef(in value))); 639return new(Unsafe.As<T, sbyte?>(ref Unsafe.AsRef(in value))); 641return new(Unsafe.As<T, char?>(ref Unsafe.AsRef(in value))); 643return new(Unsafe.As<T, short?>(ref Unsafe.AsRef(in value))); 645return new(Unsafe.As<T, int?>(ref Unsafe.AsRef(in value))); 647return new(Unsafe.As<T, long?>(ref Unsafe.AsRef(in value))); 649return new(Unsafe.As<T, ushort?>(ref Unsafe.AsRef(in value))); 651return new(Unsafe.As<T, uint?>(ref Unsafe.AsRef(in value))); 653return new(Unsafe.As<T, ulong?>(ref Unsafe.AsRef(in value))); 655return new(Unsafe.As<T, float?>(ref Unsafe.AsRef(in value))); 657return new(Unsafe.As<T, double?>(ref Unsafe.AsRef(in value))); 659return new(Unsafe.As<T, DateTime?>(ref Unsafe.AsRef(in value))); 661return new(Unsafe.As<T, DateTimeOffset?>(ref Unsafe.AsRef(in value))); 664return new(Unsafe.As<T, ArraySegment<byte>>(ref Unsafe.AsRef(in value))); 666return new(Unsafe.As<T, ArraySegment<char>>(ref Unsafe.AsRef(in value))); 671return new Value(StraightCastFlag<T>.Instance, Unsafe.As<T, ulong>(ref value)); 674return 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"/>. 106public static implicit operator Value(byte value) => new(value); 107public static explicit operator byte(in Value value) => value.GetValue<byte>(); 108public static implicit operator Value(byte? value) => new(value); 109public static explicit operator byte?(in Value value) => value.GetValue<byte?>(); 132public static implicit operator Value(sbyte value) => new(value); 133public static explicit operator sbyte(in Value value) => value.GetValue<sbyte>(); 134public static implicit operator Value(sbyte? value) => new(value); 135public static explicit operator sbyte?(in Value value) => value.GetValue<sbyte?>(); 158public static implicit operator Value(bool value) => new(value); 159public static explicit operator bool(in Value value) => value.GetValue<bool>(); 160public static implicit operator Value(bool? value) => new(value); 161public static explicit operator bool?(in Value value) => value.GetValue<bool?>(); 184public static implicit operator Value(char value) => new(value); 185public static explicit operator char(in Value value) => value.GetValue<char>(); 186public static implicit operator Value(char? value) => new(value); 187public static explicit operator char?(in Value value) => value.GetValue<char?>(); 210public static implicit operator Value(short value) => new(value); 211public static explicit operator short(in Value value) => value.GetValue<short>(); 212public static implicit operator Value(short? value) => new(value); 213public static explicit operator short?(in Value value) => value.GetValue<short?>(); 236public static implicit operator Value(int value) => new(value); 237public static explicit operator int(in Value value) => value.GetValue<int>(); 238public static implicit operator Value(int? value) => new(value); 239public static explicit operator int?(in Value value) => value.GetValue<int?>(); 262public static implicit operator Value(long value) => new(value); 263public static explicit operator long(in Value value) => value.GetValue<long>(); 264public static implicit operator Value(long? value) => new(value); 265public static explicit operator long?(in Value value) => value.GetValue<long?>(); 288public static implicit operator Value(ushort value) => new(value); 289public static explicit operator ushort(in Value value) => value.GetValue<ushort>(); 290public static implicit operator Value(ushort? value) => new(value); 291public static explicit operator ushort?(in Value value) => value.GetValue<ushort?>(); 314public static implicit operator Value(uint value) => new(value); 315public static explicit operator uint(in Value value) => value.GetValue<uint>(); 316public static implicit operator Value(uint? value) => new(value); 317public static explicit operator uint?(in Value value) => value.GetValue<uint?>(); 340public static implicit operator Value(ulong value) => new(value); 341public static explicit operator ulong(in Value value) => value.GetValue<ulong>(); 342public static implicit operator Value(ulong? value) => new(value); 343public static explicit operator ulong?(in Value value) => value.GetValue<ulong?>(); 366public static implicit operator Value(float value) => new(value); 367public static explicit operator float(in Value value) => value.GetValue<float>(); 368public static implicit operator Value(float? value) => new(value); 369public static explicit operator float?(in Value value) => value.GetValue<float?>(); 392public static implicit operator Value(double value) => new(value); 393public static explicit operator double(in Value value) => value.GetValue<double>(); 394public static implicit operator Value(double? value) => new(value); 395public static explicit operator double?(in Value value) => value.GetValue<double?>(); 418public static implicit operator Value(Size value) => new(value); 419public static explicit operator Size(in Value value) => value.GetValue<Size>(); 420public static implicit operator Value(Size? value) => new(value); 421public static explicit operator Size?(in Value value) => value.GetValue<Size?>(); 444public static implicit operator Value(Point value) => new(value); 445public static explicit operator Point(in Value value) => value.GetValue<Point>(); 446public static implicit operator Value(Point? value) => new(value); 447public static explicit operator Point?(in Value value) => value.GetValue<Point?>(); 477public static implicit operator Value(Color value) => new(value); 478public static explicit operator Color(in Value value) => value.GetValue<Color>(); 479public static implicit operator Value(Color? value) => new(value); 480public static explicit operator Color?(in Value value) => value.GetValue<Color?>(); 516public static implicit operator Value(DateTimeOffset value) => new(value); 517public static explicit operator DateTimeOffset(in Value value) => value.GetValue<DateTimeOffset>(); 518public static implicit operator Value(DateTimeOffset? value) => new(value); 519public static explicit operator DateTimeOffset?(in Value value) => value.GetValue<DateTimeOffset?>(); 542public static implicit operator Value(DateTime value) => new(value); 543public static explicit operator DateTime(in Value value) => value.GetValue<DateTime>(); 544public static implicit operator Value(DateTime? value) => new(value); 545public static explicit operator DateTime?(in Value value) => value.GetValue<DateTime?>(); 565public static implicit operator Value(ArraySegment<byte> value) => new(value); 566public static explicit operator ArraySegment<byte>(in Value value) => value.GetValue<ArraySegment<byte>>(); 584public static implicit operator Value(ArraySegment<char> value) => new(value); 585public static explicit operator ArraySegment<char>(in Value value) => value.GetValue<ArraySegment<char>>(); 589public static implicit operator Value(decimal value) => new(value); 590public static explicit operator decimal(in Value value) => value.GetValue<decimal>(); 591public static implicit operator Value(decimal? value) => value.HasValue ? new(value.Value) : new(value); 592public 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. 600public 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)
14public override Color To(in Value value)
System\Value.PackedDateTimeOffsetFlag.cs (1)
12public override DateTimeOffset To(in Value value) => value._union.PackedDateTimeOffset.Extract();
System\Value.StraightCastFlag.cs (1)
16public 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"/>. 24public abstract object ToObject(in Value value); 38public override object ToObject(in Value value) => To(value)!; 39public 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)
12public override DateTimeOffset To(in Value value) => new(new DateTime(value._union.Ticks, DateTimeKind.Utc));