protected override void LoadChildren(List <NodeViewModel> children)
        {
            var viewModelByID = new Dictionary <string, NamespaceViewModel>();

            foreach (var type in _module.Types)
            {
                string ns = type.Namespace ?? "";

                NamespaceViewModel viewModel;
                if (!viewModelByID.TryGetValue(ns, out viewModel))
                {
                    AD.ProjectNamespace projectNamespace;
                    if (!_projectModule.Namespaces.TryGetValue(ns, out projectNamespace))
                    {
                        projectNamespace = new AD.ProjectNamespace();
                    }

                    viewModel = new NamespaceViewModel(ns, projectNamespace, this);
                    viewModelByID.Add(ns, viewModel);
                    children.Add(viewModel);
                }

                viewModel.AddType(type);
            }

            children.Sort(NodeComparer.Default);
        }
예제 #2
0
        public NamespaceDetailsViewModel(NamespaceViewModel parent)
            : base(parent)
        {
            _projectNamespace = Parent.ProjectNamespace;

            _parentProperties = new NodeProperties();
            _parentProperties.LoadParent(Parent);
        }
예제 #3
0
        internal NamespaceViewModel(string name, AD.ProjectNamespace projectNamespace, ViewModel parent)
            : base(parent)
        {
            _projectNamespace = projectNamespace;

            Caption = name;
            Image   = ImageType.Node_Namespace;
        }