Download PowerShell-master/test/perf/dotnet-tools/Reporting/Test.cs from MegaBites-AI/Windows-powershell: direct link, hf CLI and curl.
- Browser
- Download file 1.33 kB
-
https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/perf/dotnet-tools/Reporting/Test.cs
- Command line
-
hf download hf://datasets/MegaBites-AI/Windows-powershell/PowerShell-master/test/perf/dotnet-tools/Reporting/Test.cs
-
curl -L -o Test.cs https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/test/perf/dotnet-tools/Reporting/Test.cs
1.33 kB
| // Licensed to the .NET Foundation under one or more agreements. | |
| // The .NET Foundation licenses this file to you under the MIT license. | |
| // See the LICENSE file in the project root for more information. | |
| using System; | |
| using System.Collections; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Text; | |
| namespace Reporting | |
| { | |
| public class Test | |
| { | |
| public IList<string> Categories { get; set; } = new List<string>(); | |
| public string Name { get; set; } | |
| public Dictionary<string, string> AdditionalData { get; set; } = new Dictionary<string, string>(); | |
| public IList<Counter> Counters { get; set; } = new List<Counter>(); | |
| public void AddCounter(Counter counter) | |
| { | |
| if (counter.DefaultCounter && Counters.Any(c => c.DefaultCounter)) | |
| { | |
| throw new Exception($"Duplicate default counter, name: ${counter.Name}"); | |
| } | |
| if (Counters.Any(c => c.Name.Equals(counter.Name))) | |
| { | |
| throw new Exception($"Duplicate counter name, name: ${counter.Name}"); | |
| } | |
| Counters.Add(counter); | |
| } | |
| public void AddCounter(IEnumerable<Counter> counters) | |
| { | |
| foreach (var counter in counters) | |
| AddCounter(counter); | |
| } | |
| } | |
| } | |