Пример #1
0
        public static int AddType(JObject jo)
        {
            var hash = "t_" + jo.ToString().GetHashCode();

            lock (TypeHashes)
            {
                var idx = 0;
                if (TypeHashes.Contains(hash) == false)
                {
                    TypeHashes.Add(hash);
                    idx = TypeHashes.IndexOf(hash);
                    Types.Add(idx, jo);
                }
            }
            return(TypeHashes.IndexOf(hash));
        }
Пример #2
0
        public static int AddType(JObject jo)
        {
            var hash = string.Format("t_{0}", jo.ToString().GetHashCode());

            lock (TypeHashes)
            {
                if (TypeHashes.Contains(hash))
                {
                    return(TypeHashes.IndexOf(hash));
                }

                TypeHashes.Add(hash);
                var idx = TypeHashes.IndexOf(hash);
                Types.Add(idx, jo);
            }

            return(TypeHashes.IndexOf(hash));
        }