Exemple #1
0
        private SolutionExplorerItem(Guid id, string name, SolutionExplorerItem parent)
        {
            if (name == null)
            {
                throw new ArgumentNullException(nameof(name));
            }

            Id         = id;
            TextId     = id.ToString();
            Name       = name;
            Parent     = parent;
            ChildItems = new ObservableCollection <SolutionExplorerItem>();
        }
        public SolutionExplorerControl()
        {
            _compositionsItem = new SolutionExplorerItem(CompositionType.Composition);
            _strategiesItem   = new SolutionExplorerItem(CompositionType.Strategy);


            InitializeComponent();

            ExplorerTree.Items = new List <SolutionExplorerItem>
            {
                _compositionsItem,
                _strategiesItem,
            };
        }
Exemple #3
0
        public SolutionExplorerItem(CompositionDiagramElement element, SolutionExplorerItem parent)
            : this(element.TypeId, element.Name, parent)
        {
            if (element == null)
            {
                throw new ArgumentNullException(nameof(element));
            }

            if (parent == null)
            {
                throw new ArgumentNullException(nameof(parent));
            }

            Type = parent.Type;

            Element = new CompositionItem(parent.Type, element);
            Element.Element.PropertyChanged += OnElementPropertyChanged;
        }