Example #1
0
        //Methods:



        public void Initialize()
        {
            SearchDriver search = new SearchDriver();

            Drive.Clear();
            foreach (DirectoryInfo d in search.SearchParrentDirectory())
            {
                Drive.Add(d);
            }
        }
Example #2
0
        private void InitHierarchy()//Initialize Hierarchy collection
        {
            SearchDriver search = new SearchDriver();
            ObservableCollection <HierarchyDrive> i = new ObservableCollection <HierarchyDrive>();

            try
            {
                foreach (DirectoryInfo d in search.SearchParrentDirectory())
                {
                    i.Add(new HierarchyDrive(d));
                }
            }
            catch
            {
            }
            Window.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate()
            {
                foreach (HierarchyDrive h in i)
                {
                    DriveHier.Add(h);
                }
            });
        }
Example #3
0
        public void SearchDirectoryE()//search for name
        {
            if (Directory != null)
            {
                try
                {
                    foreach (DirectoryInfo d in Directory.GetDirectories(Str))
                    {
                        Explorer.Window.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate()
                        {
                            Explorer.Drive.Add(d);
                        });
                    }

                    foreach (FileInfo d in Directory.GetFiles(Str))
                    {
                        Explorer.Window.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate()
                        {
                            Explorer.Drive.Add(d);
                        });
                    }
                    IEnumerable <DirectoryInfo> dir = Directory.EnumerateDirectories();
                    foreach (DirectoryInfo d in dir)
                    {
                        Directory = d;
                        SearchDirectoryE();
                    }
                }
                catch
                {
                }
            }

            else
            {
                SearchDriver search = new SearchDriver();
                foreach (DirectoryInfo dd in search.SearchParrentDirectory())
                {
                    Directory = dd;
                    try
                    {
                        foreach (DirectoryInfo d in Directory.GetDirectories(Str))
                        {
                            Explorer.Window.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate()
                            {
                                Explorer.Drive.Add(d);
                            });
                        }

                        foreach (FileInfo d in Directory.GetFiles(Str))
                        {
                            Explorer.Window.Dispatcher.BeginInvoke(DispatcherPriority.Normal, (ThreadStart) delegate()
                            {
                                Explorer.Drive.Add(d);
                            });
                        }

                        IEnumerable <DirectoryInfo> dir = Directory.EnumerateDirectories();
                        foreach (DirectoryInfo d in dir)
                        {
                            Directory = d;
                            SearchDirectoryE();
                        }
                    }
                    catch
                    {
                        MessageBox.Show("sdggggggggggg");
                    }
                }
            }
        }