Пример #1
0
        public void SetItem(IPerformanceCounterTo model)
        {
            ItemServerCounters   = new List <IPerformanceCountersByMachine>();
            ItemResourceCounters = new List <IPerformanceCountersByResource>();
            var performanceCountersByMachines = model.GetServerCountersTo();

            foreach (var performanceCountersByMachine in performanceCountersByMachines)
            {
                ItemServerCounters.Add(performanceCountersByMachine);
            }
            var performanceCountersByResources = model.GetResourceCountersTo();

            foreach (var performanceCountersByResource in performanceCountersByResources)
            {
                ItemResourceCounters.Add(performanceCountersByResource);
            }
            ItemResourceCounters.Add(CreateNewCounter());
        }
Пример #2
0
        private void InitializeTos(IPerformanceCounterTo nativeCounters)
        {
            ServerCounters.Clear();
            ResourceCounters.Clear();
            var performanceCountersByMachines = nativeCounters.GetServerCountersTo();

            foreach (var performanceCountersByMachine in performanceCountersByMachines)
            {
                RegisterPropertyChanged(performanceCountersByMachine);
                ServerCounters.Add(performanceCountersByMachine);
            }
            var performanceCountersByResources = nativeCounters.GetResourceCountersTo();

            foreach (var performanceCountersByResource in performanceCountersByResources)
            {
                RegisterPropertyChanged(performanceCountersByResource);
                ResourceCounters.Add(performanceCountersByResource);
            }
            ResourceCounters.Add(CreateNewCounter());
            SetItem(nativeCounters);
        }