public static PCWrapper.CounterInstance GetInstance(string name) { if (!PCWrapper.isInitialised) { PCWrapper.Init(); } if (PCWrapper.instances == null) { PCWrapper.instances = new Dictionary <string, PCWrapper.CounterInstance>(); } PCWrapper.CounterInstance counterInstance = PCWrapper.instances.TryGetValue(name); if (counterInstance == null) { counterInstance = new PCWrapper.CounterInstance(name, PCWrapper.totalInstance); counterInstance.Init(); PCWrapper.instances[name] = counterInstance; } return(counterInstance); }
public CounterInstance(string name, PCWrapper.CounterInstance ii) : this(name) { this.InnerInstance = ii; }