public XWPKeyCommandContext(XWPKeyCommand DefaultKey, XElement XElement) : base(XElement, true) { _defaultKeyCommand = DefaultKey; XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog); _contextType = reader.ReadAttributeEnum("context", XWPKeyContextType.undefined); }
public XWPMenuItem(XElement XElement) { XmlLinqElementReader reader = new XmlLinqElementReader(XElement, XOApplication.xmlReaderLog); _caption = reader.ReadAttribute("caption", true); _tableName = reader.ReadAttribute("tableName"); _children = reader.GetChildren("MenuItem", Range.NotBound).Select(p=>new XWPMenuItem(p)).ToArray(); if (!string.IsNullOrEmpty(_tableName) && _children.Length > 0) XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, XElement, (string)null, "Menu item can't have tableName not null along with children menu items, tableName will be ignored.", false); if (string.IsNullOrEmpty(_tableName) && _children.Length == 0) XmlLinqReaderLog.WriteToLog(XOApplication.xmlReaderLog, XElement, (string)null, "Menu item tableName is empty and doesn't contain children menu items.", false); _key = new XWPKeyCommand(XElement, false); }
internal XWPKey(XWPKeyCommand KeyCommand, string Key) { _keyCommand = KeyCommand; if (!string.IsNullOrEmpty(Key)) { string[] strs = Key.Split(','); if (strs.Length == 1) { _key = strs[0].Trim().ToUpper(); } else { _modifyers = strs[0].Split('|'); _key = strs[1].Trim().ToUpper(); } } }