servuo/Server/Diagnostics/TargetProfile.cs
VitaNex f840e50340 Updated .editorconfig file with advanced configuration settings that will help maintain user code style and best practices with most IDE's.
Complete core housekeeping operation using "Profile 1" with new .editorconfig settings.
2021-01-15 12:51:10 -08:00

34 lines
No EOL
687 B
C#

#region References
using System;
using System.Collections.Generic;
#endregion
namespace Server.Diagnostics
{
public class TargetProfile : BaseProfile
{
private static readonly Dictionary<Type, TargetProfile> _profiles = new Dictionary<Type, TargetProfile>();
public static IEnumerable<TargetProfile> Profiles => _profiles.Values;
public static TargetProfile Acquire(Type type)
{
if (!Core.Profiling)
{
return null;
}
if (!_profiles.TryGetValue(type, out var prof))
{
_profiles.Add(type, prof = new TargetProfile(type));
}
return prof;
}
public TargetProfile(Type type)
: base(type.FullName)
{ }
}
}