Exemplo n.º 1
0
        public static void PathSeat(object sender, ComboBox item, RoutedEventArgs e)
        {
            var dir  = new DirectoryInfo(Configuration.Conf.PathStart);
            var path = new PathStart {
                Path = new ObservableCollection <PathStart>()
            };

            DirectoryInfo[] dirs = dir.GetDirectories("*", SearchOption.TopDirectoryOnly);
            foreach (DirectoryInfo di in dirs)
            {
                path.Path.Add(new PathStart {
                    Namepath = di.FullName, Iconpath = IconsAdd.Extract(di.FullName)
                });
            }
            item.ItemsSource = path.Path;
        }
Exemplo n.º 2
0
        public static void PathNow(object sender, ComboBox combobox, ComboBox combonow, SelectionChangedEventArgs e)
        {
            var           item = (PathStart)combobox.SelectedValue;
            DirectoryInfo dir  = new DirectoryInfo(item.NamePath);
            var           path = new PathStart {
                PathNew = new ObservableCollection <PathStart>()
            };

            DirectoryInfo[] dirs = dir.GetDirectories("*", SearchOption.TopDirectoryOnly);
            foreach (DirectoryInfo di in dirs)
            {
                path.PathNew.Add(new PathStart {
                    Pathnow = di.Name, Iconpathnow = IconsAdd.Extract(di.FullName)
                });
            }
            combonow.ItemsSource = path.PathNew;
        }