DoubleProperty.cs
1 // Copyright (c) Microsoft Corporation 2 // The Microsoft Corporation licenses this file to you under the MIT license. 3 // See the LICENSE file in the project root for more information. 4 5 using System.Text.Json; 6 using System.Text.Json.Serialization; 7 8 namespace Microsoft.PowerToys.Settings.UI.Library 9 { 10 // Represents the configuration property of the settings that store Double type. 11 public class DoubleProperty 12 { 13 public DoubleProperty() 14 { 15 Value = 0.0; 16 } 17 18 public DoubleProperty(double value) 19 { 20 Value = value; 21 } 22 23 // Gets or sets the double value of the settings configuration. 24 [JsonPropertyName("value")] 25 public double Value { get; set; } 26 27 // Returns a JSON version of the class settings configuration class. 28 public override string ToString() 29 { 30 return JsonSerializer.Serialize(this, SettingsSerializationContext.Default.DoubleProperty); 31 } 32 } 33 }