상속: System.Windows.Controls.TextBox
        public SelectionNode(VplControl hostCanvas) : base(hostCanvas)
        {
            searchTextBox           = new SearchTextBox();
            searchTextBox.OnSearch += searchTextBox_OnSearch;

            var tempTypeList = new List <Type>();

            AddControlToNode(searchTextBox);

            listBox.DisplayMemberPath = "Name";
            listBox.MaxHeight         = 140;

            // Mine
            listBox.MinWidth = 150;

            AddControlToNode(listBox);


            switch (hostCanvas.NodeTypeMode)
            {
            case NodeTypeModes.OnlyInternalTypes:
                tempTypeList.AddRange(
                    ClassUtility.GetTypesInNamespace(Assembly.GetExecutingAssembly(), "TUM.CMS.VplControl.Nodes")
                    .ToList());
                break;

            case NodeTypeModes.OnlyExternalTypes:
                tempTypeList.AddRange(hostCanvas.ExternalNodeTypes);
                break;

            case NodeTypeModes.All:
                tempTypeList.AddRange(
                    ClassUtility.GetTypesInNamespace(Assembly.GetExecutingAssembly(), "TUM.CMS.VplControl.Nodes")
                    .ToList());
                tempTypeList.AddRange(hostCanvas.ExternalNodeTypes);
                break;
            }

            tempTypeList = tempTypeList.OrderBy(x => x.Name).ToList();

            foreach (
                var type in
                tempTypeList.Where(
                    type => !type.IsAbstract && !type.IsDefined(typeof(CompilerGeneratedAttribute), true)))
            {
                typeList.Add(type);
            }

            listBox.ItemsSource               = typeList;
            searchTextBox.PreviewKeyDown     += searchTextBox_KeyDown;
            listBox.PreviewMouseLeftButtonUp += listBox_PreviewMouseLeftButtonUp;

            listBox.SelectionMode = SelectionMode.Single;


            Border.MouseLeave += SelectionNode_MouseLeave;
            MouseEnter        += SelectionNode_MouseEnter;
        }
예제 #2
0
        public SelectionNode(VplControl hostCanvas) : base(hostCanvas)
        {
            searchTextBox = new SearchTextBox();
            searchTextBox.OnSearch += searchTextBox_OnSearch;

            var tempTypeList = new List<Type>();
            AddControlToNode(searchTextBox);

            listBox.DisplayMemberPath = "Name";
            listBox.MaxHeight = 140;

            // Mine
            listBox.MinWidth = 150;

            AddControlToNode(listBox);


            switch (hostCanvas.NodeTypeMode)
            {
                case NodeTypeModes.OnlyInternalTypes:
                    tempTypeList.AddRange(
                        ClassUtility.GetTypesInNamespace(Assembly.GetExecutingAssembly(), "TUM.CMS.VplControl.Nodes")
                            .ToList());
                    break;
                case NodeTypeModes.OnlyExternalTypes:
                    tempTypeList.AddRange(hostCanvas.ExternalNodeTypes);
                    break;
                case NodeTypeModes.All:
                    tempTypeList.AddRange(
                        ClassUtility.GetTypesInNamespace(Assembly.GetExecutingAssembly(), "TUM.CMS.VplControl.Nodes")
                            .ToList());
                    tempTypeList.AddRange(hostCanvas.ExternalNodeTypes);
                    break;
            }

            tempTypeList = tempTypeList.OrderBy(x => x.Name).ToList();

            foreach (
                var type in
                    tempTypeList.Where(
                        type => !type.IsAbstract && !type.IsDefined(typeof (CompilerGeneratedAttribute), true)))
            {
                typeList.Add(type);
            }

            listBox.ItemsSource = typeList;
            searchTextBox.PreviewKeyDown += searchTextBox_KeyDown;
            listBox.PreviewMouseLeftButtonUp += listBox_PreviewMouseLeftButtonUp;

            listBox.SelectionMode = SelectionMode.Single;


            Border.MouseLeave += SelectionNode_MouseLeave;
            MouseEnter += SelectionNode_MouseEnter;
        }
예제 #3
0
        public SelectionNode(VplControl hostCanvas) : base(hostCanvas)
        {
            searchTextBox           = new SearchTextBox();
            searchTextBox.OnSearch += searchTextBox_OnSearch;

            var tempTypeList = new List <Type>();

            AddControlToNode(searchTextBox);

            listBox.DisplayMemberPath = "Name";
            listBox.MaxHeight         = 140;

            AddControlToNode(listBox);


            if (hostCanvas.NodesFilterted)
            {
                foreach (var item in hostCanvas.ExternalNodeTypes)
                {
                    if (item.Namespace.Contains(hostCanvas.NodesFilterName))
                    {
                        tempTypeList.Add(item);
                    }
                }
            }
            else
            {
                switch (hostCanvas.NodeTypeMode)
                {
                case NodeTypeModes.OnlyInternalTypes:
                    tempTypeList.AddRange(
                        ClassUtility.GetTypesInNamespace(Assembly.GetExecutingAssembly(), "TUM.CMS.VplControl.Nodes")
                        .ToList());
                    break;

                case NodeTypeModes.OnlyExternalTypes:
                    tempTypeList.AddRange(hostCanvas.ExternalNodeTypes);
                    break;

                case NodeTypeModes.All:
                    tempTypeList.AddRange(
                        ClassUtility.GetTypesInNamespace(Assembly.GetExecutingAssembly(), "TUM.CMS.VplControl.Nodes")
                        .ToList());
                    tempTypeList.AddRange(hostCanvas.ExternalNodeTypes);
                    break;
                }
            }

            tempTypeList = tempTypeList.OrderBy(x => x.Name).ToList();


            foreach (var type in tempTypeList.Where(type => !type.IsAbstract))
            {
                if (type.Name.Contains('<') || type.Name.Contains("ComboboxItem"))
                {
                }
                else
                {
                    typeList.Add(type);
                }
            }


            listBox.ItemsSource               = typeList;
            searchTextBox.PreviewKeyDown     += searchTextBox_KeyDown;
            listBox.PreviewMouseLeftButtonUp += listBox_PreviewMouseLeftButtonUp;

            listBox.SelectionMode = SelectionMode.Single;


            Border.MouseLeave += SelectionNode_MouseLeave;
            MouseEnter        += SelectionNode_MouseEnter;
        }