github.com/myhau/pulumi/pkg/v3@v3.70.2-0.20221116134521-f2775972e587/codegen/testing/test/testdata/external-enum/dotnet/Local/Enums.cs (about) 1 // *** WARNING: this file was generated by test. *** 2 // *** Do not edit by hand unless you're certain you know what you are doing! *** 3 4 using System; 5 using System.ComponentModel; 6 using Pulumi; 7 8 namespace Pulumi.Example.Local 9 { 10 [EnumType] 11 public readonly struct MyEnum : IEquatable<MyEnum> 12 { 13 private readonly double _value; 14 15 private MyEnum(double value) 16 { 17 _value = value; 18 } 19 20 public static MyEnum Pi { get; } = new MyEnum(3.1415); 21 public static MyEnum Small { get; } = new MyEnum(1e-07); 22 23 public static bool operator ==(MyEnum left, MyEnum right) => left.Equals(right); 24 public static bool operator !=(MyEnum left, MyEnum right) => !left.Equals(right); 25 26 public static explicit operator double(MyEnum value) => value._value; 27 28 [EditorBrowsable(EditorBrowsableState.Never)] 29 public override bool Equals(object? obj) => obj is MyEnum other && Equals(other); 30 public bool Equals(MyEnum other) => _value == other._value; 31 32 [EditorBrowsable(EditorBrowsableState.Never)] 33 public override int GetHashCode() => _value.GetHashCode(); 34 35 public override string ToString() => _value.ToString(); 36 } 37 }