using System.ComponentModel; using System.IO; using System.Runtime.CompilerServices; using System.Xml.Serialization; using Configuration.Annotations; namespace Configuration { [XmlRoot(Namespace = "urn:horizon-configuration-schema", ElementName = "Configuration")] public class Configuration : INotifyPropertyChanged { private bool _atomicOperations = true; private bool _enabled; private string _lastFolder = "C:\\Users"; private bool _launchOnBoot; private bool _showBalloonTooltips = true; private bool _networkSharing = false; private NotifyFilters _notifyFilters = NotifyFilters.LastWrite | NotifyFilters.Attributes; public NotifyFilters NotifyFilters { get => _notifyFilters; set { if (value == _notifyFilters) { return; } _notifyFilters = value; OnPropertyChanged(); } } public bool NetworkSharing { get => _networkSharing; set { if (value == _networkSharing) { return; } _networkSharing = value; OnPropertyChanged(); } } public bool ShowBalloonTooltips { get => _showBalloonTooltips; set { if (value == _showBalloonTooltips) { return; } _showBalloonTooltips = value; OnPropertyChanged(); } } public bool Enabled { get => _enabled; set { if (value == _enabled) { return; } _enabled = value; OnPropertyChanged(); } } public bool LaunchOnBoot { get => _launchOnBoot; set { if (value == _launchOnBoot) { return; } _launchOnBoot = value; OnPropertyChanged(); } } public string LastFolder { get => _lastFolder; set { if (value == _lastFolder) { return; } _lastFolder = value; OnPropertyChanged(); } } public bool AtomicOperations { get => _atomicOperations; set { if (value == _atomicOperations) { return; } _atomicOperations = value; OnPropertyChanged(); } } public CaptureMode CaptureMode { get; set; } = CaptureMode.Window; public event PropertyChangedEventHandler PropertyChanged; [NotifyPropertyChangedInvocator] protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } } }