public static TreeViewItemHeaderControl Create(BitmapImage Image, string Text)
        {
            TreeViewItemHeaderControl NewTreeViewItemHeaderControl = new TreeViewItemHeaderControl();

            NewTreeViewItemHeaderControl.Icon.Source = Image;
            NewTreeViewItemHeaderControl.Text.Text   = Text;
            return(NewTreeViewItemHeaderControl);
        }
예제 #2
0
        public ThingItemsHolder(PanelControlTag PanelTag)
        {
            this.PanelTag = PanelTag;

            ThingBrowserItem = new TreeViewItem
            {
                Header = TreeViewItemHeaderControl.Create(Icons.GetIcon(65), PanelTag.Name),
                Tag    = this
            };
            ThingBrowserItem.MouseDoubleClick += ThingBrowserItem_MouseDoubleClick;

            TransportsBrowserItem = new TreeViewItem
            {
                Header = TreeViewItemHeaderControl.Create(Icons.GetIcon(136), "Transport"),
                Tag    = this
            };
            ThingBrowserItem.Items.Add(TransportsBrowserItem);

            DriversBrowserItem = new TreeViewItem
            {
                Header = TreeViewItemHeaderControl.Create(Icons.GetIcon(919), "Drivers"),
                Tag    = this
            };
            ThingBrowserItem.Items.Add(DriversBrowserItem);

            ScriptsBrowserItem = new TreeViewItem
            {
                Header = TreeViewItemHeaderControl.Create(Icons.GetIcon(1633), "Scripts"),
                Tag    = this
            };
            ThingBrowserItem.Items.Add(ScriptsBrowserItem);

            FilesBrowserItem = new TreeViewItem
            {
                Header = TreeViewItemHeaderControl.Create(Icons.GetIcon(471), "Files"),
                Tag    = this
            };
            FilesBrowserItem.MouseDoubleClick += FilesBrowserItem_MouseDoubleClick;
            ThingBrowserItem.Items.Add(FilesBrowserItem);

            foreach (IOWLOSTransport ThingTransport in PanelTag.Thing.transports)
            {
                TreeViewItem ThingTransportItem = new TreeViewItem
                {
                    Header = ThingTransport.connection.name,
                    Tag    = ThingTransport
                };
                TransportsBrowserItem.Items.Add(ThingTransportItem);
            }

            PanelTag.Thing.OnNewDriver += NewThing_OnNewDriver;
        }