Spring – Rev 1
?pathlinks?
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Xml.Serialization;
using Configuration.Properties;
namespace Configuration
{
[XmlRoot(ElementName = "Charge")]
public class Charge : INotifyPropertyChanged
{
#region Public Events & Delegates
public event PropertyChangedEventHandler PropertyChanged;
#endregion
#region Public Enums, Properties and Fields
[XmlElement(ElementName = "Keyboard")]
public bool Keyboard
{
get => _keyboard;
set
{
if (value == _keyboard)
{
return;
}
_keyboard = value;
OnPropertyChanged();
}
}
[XmlElement(ElementName = "MouseMove")]
public bool MouseMove
{
get => _mouseMove;
set
{
if (value == _mouseMove)
{
return;
}
_mouseMove = value;
OnPropertyChanged();
}
}
[XmlElement(ElementName = "MouseClick")]
public bool MouseClick
{
get => _mouseClick;
set
{
if (value == _mouseClick)
{
return;
}
_mouseClick = value;
OnPropertyChanged();
}
}
[XmlElement(ElementName = "ChargeSeconds")]
public int ChargeSeconds
{
get => _chargeSeconds;
set
{
if (value == _chargeSeconds)
{
return;
}
_chargeSeconds = value;
OnPropertyChanged();
}
}
[XmlElement(ElementName = "MaximumRepeats")]
public int MaximumRepeats
{
get => _maximumRepeats;
set
{
if (value == _maximumRepeats)
{
return;
}
_maximumRepeats = value;
OnPropertyChanged();
}
}
#endregion
#region Private Delegates, Events, Enums, Properties, Indexers and Fields
private int _chargeSeconds = 2;
private bool _keyboard = true;
private int _maximumRepeats = 5;
private bool _mouseClick;
private bool _mouseMove;
#endregion
#region Constructors, Destructors and Finalizers
[UsedImplicitly]
public Charge()
{
}
#endregion
#region Private Methods
[NotifyPropertyChangedInvocator]
protected virtual void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
#endregion
}
}