Beispiel #1
0
        private bool ListBoxComponentsFilter(object item)
        {
            SvnComponent component = (item as ListBoxItem).Tag as SvnComponent;

            return(component.Name.Contains(textBoxComponentFilter.Text));
        }
Beispiel #2
0
        private void listBoxComponentList_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            try
            {
                treeViewComponent.Items.Clear();
                ListBoxItem selectedItem = listBoxComponentList.SelectedItem as ListBoxItem;

                if (selectedItem != null &&
                    selectedItem.Tag != null)
                {
                    SvnComponent            selectedComponent = selectedItem.Tag as SvnComponent;
                    List <SvnListEventArgs> forlderList       = myIfsSvn.GetFolderList(new SvnUriTarget(selectedComponent.Path));

                    StackPanel treeItemStack = new StackPanel();
                    treeItemStack.Orientation = Orientation.Horizontal;

                    Label lbl = new Label();
                    lbl.Content = forlderList[0].Name;

                    Image treeItemImage = new Image();
                    treeItemImage.Source = rootBi;

                    treeItemStack.Children.Add(treeItemImage);
                    treeItemStack.Children.Add(lbl);

                    TreeViewItem rootNodeItem = new TreeViewItem();
                    rootNodeItem.Header     = treeItemStack;
                    rootNodeItem.Tag        = forlderList[0];
                    rootNodeItem.IsExpanded = true;

                    forlderList.RemoveAt(0);

                    TreeViewItem        nodeItem;
                    List <TreeViewItem> nodeItemList = new List <TreeViewItem>();
                    foreach (SvnListEventArgs folder in forlderList)
                    {
                        nodeItem      = new TreeViewItem();
                        nodeItem.Name = folder.Name;

                        treeItemStack             = new StackPanel();
                        treeItemStack.Orientation = Orientation.Horizontal;

                        lbl         = new Label();
                        lbl.Content = folder.Name;

                        treeItemImage        = new Image();
                        treeItemImage.Source = bi;

                        treeItemStack.Children.Add(treeItemImage);
                        treeItemStack.Children.Add(lbl);

                        nodeItem.Header = treeItemStack;
                        nodeItem.Tag    = folder;

                        nodeItem.Expanded += new RoutedEventHandler(nodeItem_Expanded);

                        nodeItemList.Add(nodeItem);
                    }

                    if (nodeItemList.Count > 0)
                    {
                        rootNodeItem.ItemsSource = nodeItemList;
                        treeViewComponent.Items.Add(rootNodeItem);
                    }
                }
            }
            catch (Exception ex)
            {
                ModernDialog.ShowMessage(ex.Message, "Error Loading", MessageBoxButton.OK);
            }
        }