private Dictionary <ushort, EntityDefProperties> GetHmfProperties(List <object> props) { Dictionary <ushort, EntityDefProperties> dictionary = new Dictionary <ushort, EntityDefProperties>(); if (props != null) { short num = -1; for (int i = 0; i < props.Count; i++) { KeyValuePair <object, object> pair = ((Dictionary <object, object>)props[i]).First <KeyValuePair <object, object> >(); List <object> list = null; List <object> list2 = null; foreach (object obj2 in (List <object>)pair.Value) { List <object> list3 = (List <object>)obj2; if (((string)list3[0]) == "Type") { list2 = list3; } else if (((string)list3[0]) == "Flags") { list = list3; break; } } num = (short)(num + 1); if ((list == null) || this.CheckFlags(((string)list[1]).Trim())) { EntityDefProperties properties = new EntityDefProperties { Name = (string)pair.Key }; if (list2 != null) { properties.VType = TypeMapping.GetVObject(((string)list2[1]).Trim()); } if (!dictionary.ContainsKey((ushort)num)) { dictionary.Add((ushort)num, properties); } } } } return(dictionary); }
private Dictionary <ushort, EntityDefProperties> GetHmfProperties(List <object> props) { Dictionary <ushort, EntityDefProperties> propList = new Dictionary <ushort, EntityDefProperties>(); if (props != null) { short index = -1; //属性索引 for (int i = 0; i < props.Count; i++) //遍历实体的所有属性 { KeyValuePair <object, object> prop = ((Dictionary <object, object>)props[i]).First(); List <object> flag = null; List <object> node = null; foreach (var item in (List <object>)prop.Value)//遍历属性的字段 { List <object> arg = (List <object>)item; if ((string)arg[0] == EL_TYPE)//查找类型字段 { node = arg; } else if ((string)arg[0] == EL_FLAGS)//查找客户端标记字段 { flag = arg; break; } } index++; if (flag != null && !CheckFlags(((string)flag[1]).Trim()))//判断是否为客户端使用属性 { continue; } EntityDefProperties p = new EntityDefProperties(); p.Name = (string)prop.Key; if (node != null) { p.VType = TypeMapping.GetVObject(((string)node[1]).Trim());//To do: Trim()优化 } if (!propList.ContainsKey((ushort)index)) { propList.Add((ushort)index, p); } } } return(propList); }
private Dictionary <ushort, EntityDefProperties> GetProperties(ArrayList properties) { Dictionary <ushort, EntityDefProperties> propList = new Dictionary <ushort, EntityDefProperties>(); if (properties != null) { short index = -1; //属性索引 foreach (SecurityElement element in properties) //遍历实体的所有属性 { SecurityElement flag = null; SecurityElement node = null; foreach (SecurityElement item in element.Children) //遍历属性的字段 { if (item.Tag == EL_TYPE) //查找类型字段 { node = item; } else if (item.Tag == EL_FLAGS)//查找客户端标记字段 { flag = item; break; } } index++; if (flag != null && !CheckFlags(flag.Text.Trim()))//判断是否为客户端使用属性 { continue; } EntityDefProperties p = new EntityDefProperties(); p.Name = element.Tag; if (node != null) { p.VType = TypeMapping.GetVObject(node.Text.Trim());//To do: Trim()优化 } if (!propList.ContainsKey((ushort)index)) { propList.Add((ushort)index, p); } } } return(propList); }
private Dictionary <ushort, EntityDefProperties> GetProperties(ArrayList properties) { Dictionary <ushort, EntityDefProperties> dictionary = new Dictionary <ushort, EntityDefProperties>(); if (properties != null) { short num = -1; foreach (SecurityElement element in properties) { SecurityElement element2 = null; SecurityElement element3 = null; foreach (SecurityElement element4 in element.Children) { if (element4.Tag == "Type") { element3 = element4; } else if (element4.Tag == "Flags") { element2 = element4; break; } } num = (short)(num + 1); if ((element2 == null) || this.CheckFlags(element2.Text.Trim())) { EntityDefProperties properties2 = new EntityDefProperties { Name = element.Tag }; if (element3 != null) { properties2.VType = TypeMapping.GetVObject(element3.Text.Trim()); } if (!dictionary.ContainsKey((ushort)num)) { dictionary.Add((ushort)num, properties2); } } } } return(dictionary); }
private Dictionary<ushort, EntityDefProperties> GetHmfProperties(List<object> props) { Dictionary<ushort, EntityDefProperties> propList = new Dictionary<ushort, EntityDefProperties>(); if (props != null) { short index = -1;//属性索引 for (int i = 0; i < props.Count; i++)//遍历实体的所有属性 { KeyValuePair<object, object> prop = ((Dictionary<object, object>)props[i]).First(); List<object> flag = null; List<object> node = null; foreach (var item in (List<object>)prop.Value)//遍历属性的字段 { List<object> arg = (List<object>)item; if ((string)arg[0] == EL_TYPE)//查找类型字段 { node = arg; } else if ((string)arg[0] == EL_FLAGS)//查找客户端标记字段 { flag = arg; break; } } index++; if (flag != null && !CheckFlags(((string)flag[1]).Trim()))//判断是否为客户端使用属性 continue; EntityDefProperties p = new EntityDefProperties(); p.Name = (string)prop.Key; if (node != null) p.VType = TypeMapping.GetVObject(((string)node[1]).Trim());//To do: Trim()优化 if (!propList.ContainsKey((ushort)index)) propList.Add((ushort)index, p); } } return propList; }
private Dictionary<ushort, EntityDefProperties> GetProperties(ArrayList properties) { Dictionary<ushort, EntityDefProperties> propList = new Dictionary<ushort, EntityDefProperties>(); if (properties != null) { short index = -1;//属性索引 foreach (SecurityElement element in properties)//遍历实体的所有属性 { SecurityElement flag = null; SecurityElement node = null; foreach (SecurityElement item in element.Children)//遍历属性的字段 { if (item.Tag == EL_TYPE)//查找类型字段 { node = item; } else if (item.Tag == EL_FLAGS)//查找客户端标记字段 { flag = item; break; } } index++; if (flag != null && !CheckFlags(flag.Text.Trim()))//判断是否为客户端使用属性 continue; EntityDefProperties p = new EntityDefProperties(); p.Name = element.Tag; if (node != null) p.VType = TypeMapping.GetVObject(node.Text.Trim());//To do: Trim()优化 if (!propList.ContainsKey((ushort)index)) propList.Add((ushort)index, p); } } return propList; }
public EntityPropertyValue(EntityDefProperties property, object value) { Property = property; Value = value; }