Пример #1
0
        private static string getPropertyByName(List <JSONProxy.Property> properties, string name)
        {
            JSONProxy.Property prop = properties.Find(p => p.Name == name);

            if (prop == null)
            {
                return(string.Empty);
            }

            return((prop.Values[0] as object[])[0].ToString());
        }
Пример #2
0
        internal static StackInfo GetStackInfo(List <JSONProxy.Property> list)
        {
            JSONProxy.Property stackSize = list.Find(p => p.Name == STACKSIZE);
            if (stackSize == null)
            {
                return(new StackInfo(1, 1));
            }

            string[] stackInfo = getPropertyByName(list, STACKSIZE).Split('/');

            return(new StackInfo(Convert.ToInt32(stackInfo[0]), Convert.ToInt32(stackInfo[1])));
        }
Пример #3
0
        internal Property(JSONProxy.Property property)
        {
            this.Name = property.Name;
            Values    = new List <Tuple <string, int> >();

            foreach (object value in property.Values)
            {
                var pair = (JArray)value;
                Values.Add(new Tuple <string, int>(pair[0].ToString(), int.Parse(pair[1].ToString())));
            }

            this.DisplayMode = property.DisplayMode;
        }