| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 | using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows;namespace OpenSEMI.ClientBase.IO{    public class IOItem : DependencyObject    {        public int Index { get; set; }        public string Name { get; set; }        public string Address { get; set; }        public string Key { get; set; }        public string DisplayName { get; set; }    }    public class IOItem<T> : IOItem    {        public static DependencyProperty ValueProperty = DependencyProperty.Register("Value", typeof(T), typeof(IOItem<T>));        public T Value        {            get            {                return (T)GetValue(ValueProperty);            }            set            {                SetValue(ValueProperty, value);            }        }    }    public class AOItem : IOItem<short>    {        public static readonly DependencyProperty NewValueProperty = DependencyProperty.Register("NewValue", typeof(short), typeof(AOItem), new PropertyMetadata((short)0));        public short NewValue        {            get { return (short)GetValue(NewValueProperty); }            set { SetValue(NewValueProperty, value); }        }        public static readonly DependencyProperty TextSavedProperty = DependencyProperty.Register("TextSaved", typeof(bool), typeof(AOItem), new PropertyMetadata(true));        public bool TextSaved        {            get { return (bool)GetValue(TextSavedProperty); }            set { SetValue(TextSavedProperty, value); }        }    }    public class AOItemFloat : IOItem<float>    {        public static readonly DependencyProperty NewValueFloatProperty = DependencyProperty.Register("NewValueFloat", typeof(float), typeof(AOItem), new PropertyMetadata((float)0));        public float NewValueFloat        {            get { return (float)GetValue(NewValueFloatProperty); }            set { SetValue(NewValueFloatProperty, value); }        }        public static readonly DependencyProperty TextSavedFloatProperty = DependencyProperty.Register("TextSavedFloat", typeof(bool), typeof(AOItem), new PropertyMetadata(true));        public bool TextSavedFloat        {            get { return (bool)GetValue(TextSavedFloatProperty); }            set { SetValue(TextSavedFloatProperty, value); }        }    }}
 |