123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- using System;
- namespace Vinno.FIS.Sonopost.Features.Network
- {
- public class NetworkInterfaceInfoParam<T> : INamedObject<string>
- {
- private T _value;
- public EventHandler ValueChanged;
- public T Value
- {
- get
- {
- return _value;
- }
- set
- {
- if (!object.Equals(_value, value))
- {
- _value = value;
- ValueChanged?.Invoke(this, EventArgs.Empty);
- }
- }
- }
- public string Name
- {
- get;
- private set;
- }
- public T DefaultValue
- {
- get;
- internal set;
- }
- public bool Dirty => !object.Equals(Value, DefaultValue);
- public NetworkInterfaceInfoParam(string name, T value)
- {
- Name = name;
- _value = value;
- DefaultValue = value;
- }
- internal void UpdateDefaultValue(T value)
- {
- Value = value;
- DefaultValue = value;
- }
- }
- }
|