public ViewModelTypeHierarchySelectView()
 {
     TypeHierarchyPlaneList = EntityViewModelsManager.TypeHierarchyPlaneCollection;
     MainNode = EntityViewModelsManager.EntityTypeHierarchy;
     Save     = new ActionCommand(SaveChanges);
     Cancel   = new ActionCommand(TypeHierarchySelectView.Close);
 }
Exemplo n.º 2
0
        public void Add(Type type, ProtoEntityViewModel entityViewModel)
        {
            if (GetNameWithoutGenericArity(type.ToString()) == FullName)
            {
                return;
            }

            var localNode = this;
            var tempType  = type.BaseType;

            while (GetNameWithoutGenericArity(type.BaseType?.ToString()) != localNode.FullName)
            {
                while (GetNameWithoutGenericArity(tempType?.BaseType?.ToString()) != localNode.FullName)
                {
                    tempType = tempType?.BaseType;
                }

                var tempNode = localNode.Derivatives
                               .FirstOrDefault(n => n.FullName == GetNameWithoutGenericArity(tempType?.ToString()));
                if (tempNode == null)
                {
                    tempNode = new TypeHierarchy(tempType, localNode);
                    localNode.Derivatives.Add(tempNode);
                    localNode.IsChild = false;
                }

                localNode = tempNode;
                tempType  = type.BaseType;
            }

            var newNode = new TypeHierarchy(type, localNode, entityViewModel);

            localNode.Derivatives.Add(newNode);
            localNode.IsChild = false;
            localNode.EntityViewModelsList.Add(entityViewModel);
            do
            {
                localNode.EntityViewModelsFullList.Add(entityViewModel);
                localNode = localNode.Parent;
            } while (localNode != null);
        }
Exemplo n.º 3
0
 public TypeHierarchy(Type type, TypeHierarchy parent, ProtoEntityViewModel entityViewModel)
     : this(type, parent)
 {
     EntityViewModel = entityViewModel;
 }
Exemplo n.º 4
0
 public TypeHierarchy(Type type, TypeHierarchy parent) : this(type)
 {
     Parent = parent;
     Indent = parent.Indent + IndentSize;
 }