public KeyButton(KeyButtonType type, string key, string shiftKey, HidKeys hidKey, short keyWidth) { Type = type; Key = key; ShiftKey = shiftKey; KeyWidth = keyWidth; HidKey = hidKey; }
public void ReadXml(System.Xml.XmlReader reader) { //key, shiftkey, keywidth, scancode, type this.Type = (KeyButtonType)Enum.Parse(typeof(KeyButtonType), reader.GetAttribute("Type"), true); this.Key = reader.GetAttribute("Key"); this.ShiftKey = reader.GetAttribute("ShiftKey"); this.KeyWidth = short.Parse(reader.GetAttribute("KeyWidth")); this.IsChar = Convert.ToBoolean(reader.GetAttribute("IsChar")); this.HidKey = (HidKeys)Enum.Parse(typeof(HidKeys), reader.GetAttribute("HidKey"), true); this._iconName = reader.GetAttribute("IconName"); this._iconType = reader.GetAttribute("IconType"); Initialize(); }
public KeyButton(KeyButtonType type, string key, string shiftKey, HidKeys hidKey, short keyWidth, Type bitmapType, string propertyName) : this(type, key, shiftKey, hidKey, keyWidth) { if (null == bitmapType) { bitmapType = typeof(Properties.Resources); } _iconType = bitmapType.AssemblyQualifiedName; _iconName = propertyName; Initialize(); }