예제 #1
0
 public override bool Equals(object obj)
 {
     if (obj == null && this.GetType() != obj.GetType())
     {
         return(false);
     }
     else
     {
         ComboClass <T> rval = (ComboClass <T>)obj;
         return(ComboClass <T> .SafeEquals(this.Value, rval.Value));
     }
 }
예제 #2
0
        public static T GetCounters <T>(string instance)
        {
            ComboClass <Type, string> key = new ComboClass <Type, string>(typeof(T), instance);
            object ret;

            lock (_syncRoot)
            {
                if (!_cachedCounters.TryGetValue(key, out ret))
                {
                    ret = CreateCounters <T>(instance);
                    _cachedCounters.Add(key, ret);
                }
                return((T)ret);
            }
        }