Beispiel #1
0
 public void Put(IndentKey key, IndentContext iu)
 {
     lock (locker)
     {
         indentDictionary[key.GetKey()] = iu;
     }
 }
Beispiel #2
0
        public IndentContext Get(IndentKey key)
        {
            string keyStr = key.GetKey();

            lock (locker)
            {
                if (indentDictionary.ContainsKey(keyStr))
                {
                    return(indentDictionary[keyStr]);
                }
                else
                {
                    IndentContext iu = new IndentContext();
                    indentDictionary.Add(keyStr, iu);
                    return(iu);
                }
            }
        }