示例#1
0
 // Lock the object. Cannot simply use concurrent constructs on the counters
 // data-structure (like putIfAbsent) because of localization, limits etc.
 private T FindCounterImpl(string counterName, bool create)
 {
     lock (this)
     {
         T counter = counters[counterName];
         if (counter == null && create)
         {
             string localized = ResourceBundles.GetCounterName(GetName(), counterName, counterName
                                                               );
             return(AddCounterImpl(counterName, localized, 0));
         }
         return(counter);
     }
 }
 protected internal virtual string LocalizeCounterName(string counterName)
 {
     return(ResourceBundles.GetCounterName(typeof(FileSystemCounter).FullName, counterName
                                           , counterName));
 }
示例#3
0
 public override string GetDisplayName()
 {
     return(ResourceBundles.GetCounterName(groupName, GetName(), GetName()));
 }