public IEnumerable <T> ToCollection(XmlElement element, ItemChangeHandler OnItemChange) { Type objectInfo = _object.GetType(); CreatePropertyMap(_object, null); IList <T> list = new List <T>(); IList <XmlElement> elements = element.Descendants(GetProcessingElement(objectInfo)); foreach (XmlElement e in elements) { T obj = Activator.CreateInstance <T>(); // process any attribute from root element. if (!string.IsNullOrEmpty(rootElement)) { XmlElement root = e.FindElement(rootElement); ProcessAttribute(obj, root); } ProcessNode(obj, e); // raise event so that any change might take place. if (OnItemChange != null) { OnItemChange(obj); } // finally add to the list. list.Add(obj); } return(list); }
protected override void SetCursor_select(int value) { if (value != GetCursor_select()) { base.SetCursor_select(value); ItemChangeHandler?.Invoke(this, new KeyValuePair <ItemInMenu, FF8String>(Contents[value], HelpStr[value])); } }
protected override void PAGE_NEXT() { var cnt = Pages; do { base.PAGE_NEXT(); Refresh(); skipsnd = true; }while (cnt-- > 0 && !((IGMDataItem.Integer)(ITEM[0, 1])).Enabled); ItemChangeHandler?.Invoke(this, new KeyValuePair <ItemInMenu, FF8String>(Contents[CURSOR_SELECT], HelpStr[CURSOR_SELECT])); }
public IEnumerable <T> ToCollection(XElement element, ItemChangeHandler OnItemChange) { Type objectInfo = _object.GetType(); CreatePropertyMap(objectInfo); IList <T> list = new List <T>(); var query = from item in element.Descendants(GetRootElement(objectInfo)) select item; XNode[] nodes = query.ToArray(); foreach (XNode node in nodes) { T obj = Activator.CreateInstance <T>(); if (nodes[0] is XElement) { // process any attribute from root element. if (!string.IsNullOrEmpty(_rootElement)) { XElement root = element.FindElement(_rootElement); ProcessAttribute(obj, root); } XElement rootElement = node as XElement; ProcessNode(obj, rootElement); // raise event so that any change might take place. if (OnItemChange != null) { OnItemChange(obj); } // finally add to the list. list.Add(obj); } } return(list); }
//andre public static Boolean newPaymentType(string type) { ItemChangeHandler.newPaymentType(type); return(true); }
public static Boolean updateUserA(int id, string role, string status) { return(ItemChangeHandler.updateUserA(id, role, status)); }
public static Boolean removeProductType(int id) { return(ItemChangeHandler.removeProductType(id)); }
public static Boolean removeProduct(int id) { ItemChangeHandler.removeProduct(id); return(true); }
public static Boolean updateUser(int id, string userEmail, string userName, string userGender) { ItemChangeHandler.updateUser(id, userEmail, userName, userGender); return(true); }
public static Boolean updatePassword(int id, string newPassword) { ItemChangeHandler.updatePassword(id, newPassword); return(true); }
public static Boolean newUser(int roleID, string userName, string userEmail, string userPassword, string userGender, string userStatus) { ItemChangeHandler.newUser(roleID, userName, userEmail, userPassword, userGender, userStatus); return(true); }
public static Boolean insertProductType(string productTypeName, string productTypeDescription) { ItemChangeHandler.insertProductType(productTypeName, productTypeDescription); return(true); }
public static Boolean insertProduct(string productName, int productStock, int productPrice, int productTypeID) { ItemChangeHandler.insertProduct(productName, productStock, productPrice, productTypeID); return(true); }
public static Boolean updatePaymentType(int id, string type) { ItemChangeHandler.updatePaymentType(id, type); return(true); }
public IEnumerable <T> ToCollection(string requestUrl, ItemChangeHandler OnItemChange) { XmlElement element = elementProxy.GetResponseElement(requestUrl); return(ToCollection(element, OnItemChange)); }
public static Boolean removePaymentType(int id) { ItemChangeHandler.removePaymentType(id); return(true); }
public static Boolean submitProduct(int id, string productName, int productStock, int productPrice) { ItemChangeHandler.submitProduct(id, productName, productStock, productPrice); return(true); }
public static Boolean updateProductType(int id, string productTypeName, string productTypeDescription) { ItemChangeHandler.updateProductType(id, productTypeName, productTypeDescription); return(true); }
private void RefreshCompletedEvent(object sender, EventArgs e) => ItemChangeHandler?.Invoke(this, new KeyValuePair <ItemInMenu, FF8String>(Contents[CURSOR_SELECT], HelpStr[CURSOR_SELECT]));
public IEnumerable <T> ToCollection(string requestUrl, ItemChangeHandler OnItemChange) { XElement element = base.GetElement(requestUrl); return(ToCollection(element, OnItemChange)); }