@@ -27,127 +27,43 @@ internal PerformanceCounterSample(string path,
2727 UInt64 timeStamp100nSec ,
2828 UInt32 status )
2929 {
30- _path = path ;
31- _instanceName = instanceName ;
32- _cookedValue = cookedValue ;
33- _rawValue = rawValue ;
34- _secondValue = secondValue ;
35- _multiCount = multiCount ;
36- _counterType = counterType ;
37- _defaultScale = defaultScale ;
38- _timeBase = timeBase ;
39- _timeStamp = timeStamp ;
40- _timeStamp100nSec = timeStamp100nSec ;
41- _status = status ;
30+ Path = path ;
31+ InstanceName = instanceName ;
32+ CookedValue = cookedValue ;
33+ RawValue = rawValue ;
34+ SecondValue = secondValue ;
35+ MultipleCount = multiCount ;
36+ CounterType = counterType ;
37+ DefaultScale = defaultScale ;
38+ TimeBase = timeBase ;
39+ Timestamp = timeStamp ;
40+ Timestamp100NSec = timeStamp100nSec ;
41+ Status = status ;
4242 }
4343
44- public string Path
45- {
46- get { return _path ; }
47-
48- set { _path = value ; }
49- }
50-
51- private string _path = string . Empty ;
52-
53- public string InstanceName
54- {
55- get { return _instanceName ; }
56-
57- set { _instanceName = value ; }
58- }
59-
60- private string _instanceName = string . Empty ;
61-
62- public double CookedValue
63- {
64- get { return _cookedValue ; }
65-
66- set { _cookedValue = value ; }
67- }
68-
69- private double _cookedValue = 0 ;
70-
71- public UInt64 RawValue
72- {
73- get { return _rawValue ; }
74-
75- set { _rawValue = value ; }
76- }
77-
78- private UInt64 _rawValue = 0 ;
79-
80- public UInt64 SecondValue
81- {
82- get { return _secondValue ; }
83-
84- set { _secondValue = value ; }
85- }
86-
87- private UInt64 _secondValue = 0 ;
88-
89- public uint MultipleCount
90- {
91- get { return _multiCount ; }
92-
93- set { _multiCount = value ; }
94- }
44+ public string Path { get ; set ; } = string . Empty ;
9545
96- private uint _multiCount = 0 ;
46+ public string InstanceName { get ; set ; } = string . Empty ;
9747
98- public PerformanceCounterType CounterType
99- {
100- get { return _counterType ; }
101-
102- set { _counterType = value ; }
103- }
104-
105- private PerformanceCounterType _counterType = 0 ;
106-
107- public DateTime Timestamp
108- {
109- get { return _timeStamp ; }
110-
111- set { _timeStamp = value ; }
112- }
113-
114- private DateTime _timeStamp = DateTime . MinValue ;
115-
116- public UInt64 Timestamp100NSec
117- {
118- get { return _timeStamp100nSec ; }
119-
120- set { _timeStamp100nSec = value ; }
121- }
122-
123- private UInt64 _timeStamp100nSec = 0 ;
48+ public double CookedValue { get ; set ; }
12449
125- public UInt32 Status
126- {
127- get { return _status ; }
50+ public UInt64 RawValue { get ; set ; }
12851
129- set { _status = value ; }
130- }
52+ public UInt64 SecondValue { get ; set ; }
13153
132- private UInt32 _status = 0 ;
54+ public uint MultipleCount { get ; set ; }
13355
134- public UInt32 DefaultScale
135- {
136- get { return _defaultScale ; }
56+ public PerformanceCounterType CounterType { get ; set ; }
13757
138- set { _defaultScale = value ; }
139- }
58+ public DateTime Timestamp { get ; set ; } = DateTime . MinValue ;
14059
141- private UInt32 _defaultScale = 0 ;
60+ public UInt64 Timestamp100NSec { get ; set ; }
14261
143- public UInt64 TimeBase
144- {
145- get { return _timeBase ; }
62+ public UInt32 Status { get ; set ; }
14663
147- set { _timeBase = value ; }
148- }
64+ public UInt32 DefaultScale { get ; set ; }
14965
150- private UInt64 _timeBase = 0 ;
66+ public UInt64 TimeBase { get ; set ; }
15167 }
15268
15369 public class PerformanceCounterSampleSet
@@ -161,31 +77,17 @@ internal PerformanceCounterSampleSet(DateTime timeStamp,
16177 PerformanceCounterSample [ ] counterSamples ,
16278 bool firstSet ) : this ( )
16379 {
164- _timeStamp = timeStamp ;
165- _counterSamples = counterSamples ;
166- }
167-
168- public DateTime Timestamp
169- {
170- get { return _timeStamp ; }
171-
172- set { _timeStamp = value ; }
80+ Timestamp = timeStamp ;
81+ CounterSamples = counterSamples ;
17382 }
17483
175- private DateTime _timeStamp = DateTime . MinValue ;
84+ public DateTime Timestamp { get ; set ; } = DateTime . MinValue ;
17685
17786 [ SuppressMessage ( "Microsoft.Performance" , "CA1819:PropertiesShouldNotReturnArrays" ,
17887 Scope = "member" ,
17988 Target = "Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSample.CounterSamples" ,
18089 Justification = "A string[] is required here because that is the type Powershell supports" ) ]
181- public PerformanceCounterSample [ ] CounterSamples
182- {
183- get { return _counterSamples ; }
184-
185- set { _counterSamples = value ; }
186- }
187-
188- private PerformanceCounterSample [ ] _counterSamples = null ;
90+ public PerformanceCounterSample [ ] CounterSamples { get ; set ; }
18991
19092 private readonly ResourceManager _resourceMgr = null ;
19193 }
0 commit comments