Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- interface ISecuredItem<TChildType> where TChildType : class, ISecuredItem<TChildType>
- {
- SecurityDescriptor Descriptor { get; }
- IEnumerable<TChildType> Children { get; }
- }
- class RegistryKey : ISecuredItem<RegistryKey>
- {
- public SecurityDescriptor Descriptor { get; private set; }
- public IEnumerable<RegistryKey> Children { get; }
- }
- public interface ISecuredItem<TChildType>
- where TChildType : ISecuredItem<TChildType>
- {
- SecurityDescriptor Descriptor { get; }
- IEnumerable<TChildType> Children { get; }
- }
- public interface StubImplemtation : ISecuredItem<StubImplemtation> { }
- var securedItemStub = new StubISecuredItem<StubImplemtation>
- {
- ChildrenGet = () => new List<StubImplemtation>(),
- DescriptorGet = () => new SecurityDescriptor()
- };
- var children = securedItemStub.ChildrenGet();
- var descriptor = securedItemStub.DescriptorGet();
Add Comment
Please, Sign In to add comment