Last active
August 29, 2015 14:02
-
-
Save Konard/f99444400bd7109f3261 to your computer and use it in GitHub Desktop.
StaticBase представляет собой абстракцию, позволяющую реализовать статическое наследование в .NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Avalast.Helpers | |
{ | |
/// <summary>Представляет собой абстракцию, позволяющую реализовать статическое наследование в .NET</summary> | |
/// <typeparam name="TSuccessor">Тип класса наследника (требуется наличие публичного конструктора без параметров).</typeparam> | |
public abstract class StaticBase<TSuccessor> | |
where TSuccessor : StaticBase<TSuccessor>, new() | |
{ | |
protected static readonly TSuccessor Instance = new TSuccessor(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment