56 lines
1.7 KiB
C#
56 lines
1.7 KiB
C#
// /**
|
|
// * File: ManagedRoot.cs
|
|
// * Author: haraldwolff
|
|
// *
|
|
// * This file and it's content is copyrighted by the Author and / or copyright holder.
|
|
// * Any use wihtout proper permission is illegal and may lead to legal actions.
|
|
// *
|
|
// *
|
|
// **/
|
|
using System;
|
|
using System.IO;
|
|
using System.Text;
|
|
using System.Collections.Generic;
|
|
using ln.types;
|
|
namespace ln.manage
|
|
{
|
|
public class ManagedRoot : ManagedContainerBase
|
|
{
|
|
public ManagedRoot()
|
|
:base(null,"")
|
|
{
|
|
}
|
|
|
|
public override IEnumerable<PropertyDescriptor> PropertyDescriptors => new PropertyDescriptor[0];
|
|
public override string IdentityPropertyName => throw new NotImplementedException();
|
|
|
|
public override IManagedObject CreateManagedObject() => throw new NotImplementedException();
|
|
public override bool DisposeManagedObject(object identity) => throw new NotImplementedException();
|
|
public override IManagedObject GetManagedObject(object identity) => throw new KeyNotFoundException();
|
|
public override IManagedObject[] GetManagedObjects() => new IManagedObject[0];
|
|
|
|
|
|
|
|
}
|
|
public static class ManagedContainerExtensions
|
|
{
|
|
|
|
public static string[] GetContainerPath(this IManagedContainer container)
|
|
{
|
|
List<string> path = new List<string>();
|
|
Stack<IManagedContainer> stack = new Stack<IManagedContainer>();
|
|
|
|
do
|
|
{
|
|
stack.Push(container);
|
|
container = container.Parent;
|
|
} while (container != null);
|
|
|
|
while (stack.Count > 0)
|
|
path.Add(stack.Pop().Name);
|
|
|
|
return path.ToArray();
|
|
}
|
|
}
|
|
}
|