public static bool Parse(string attrEx, out Dictionary <string, ItemAttributeElement> attributes) { string[] array = attrEx.Split(new char[] { ',', '[', ']' }); if (array.Length == 0) { attributes = new Dictionary <string, ItemAttributeElement>(); return(true); } attributes = new Dictionary <string, ItemAttributeElement>(); foreach (string text in array) { if (!(text == "")) { ItemAttributeElement itemAttributeElement = ItemClassExBuilder.ParseSingleAttribute(text); if (itemAttributeElement != null) { try { attributes.Add(itemAttributeElement.AttributeName, itemAttributeElement); } catch (Exception arg) { throw new Exception(string.Format("Item Parse Error [attrEx : {1}] [AttributeName : {2}]- {0}", arg, attrEx, itemAttributeElement.AttributeName)); } } } } return(true); }
public static bool IsSameItemClassEx(string itemClass1, Dictionary <string, ItemAttributeElement> attrDict1, string itemClass2, Dictionary <string, ItemAttributeElement> attrDict2) { if (itemClass1 != itemClass2) { return(false); } if (attrDict1.Count != attrDict2.Count) { return(false); } foreach (KeyValuePair <string, ItemAttributeElement> keyValuePair in attrDict1) { if (!attrDict2.ContainsKey(keyValuePair.Key)) { return(false); } ItemAttributeElement itemAttributeElement = attrDict2.TryGetValue(keyValuePair.Key); if (itemAttributeElement.Value != keyValuePair.Value.Value) { return(false); } if (itemAttributeElement.Arg != keyValuePair.Value.Arg) { return(false); } if (itemAttributeElement.Arg2 != keyValuePair.Value.Arg2) { return(false); } } return(true); }
public static bool Parse(string itemClassEx, out string itemClass, out Dictionary <string, ItemAttributeElement> attributes) { string[] array = itemClassEx.Split(new char[] { ',', '[', ']' }); if (array.Length == 0) { Log <ItemClassExBuilder> .Logger.WarnFormat("No Data [{0}]", itemClassEx); itemClass = null; attributes = null; return(false); } itemClass = array[0]; attributes = new Dictionary <string, ItemAttributeElement>(); foreach (string text in array.Skip(1)) { if (!(text == "")) { ItemAttributeElement itemAttributeElement = ItemClassExBuilder.ParseSingleAttribute(text); if (itemAttributeElement != null) { try { attributes.Add(itemAttributeElement.AttributeName, itemAttributeElement); } catch (Exception arg) { throw new Exception(string.Format("Item Parse Error [ItemClass : {1}] [AttributeName : {2}]- {0}", arg, itemClassEx, itemAttributeElement.AttributeName)); } } } } return(true); }