Beispiel #1
0
        private void loadElements2(string path)
        {
            try
            {
                MyDir dirs = new MyDir(path);
                List <DiscElements> discElements = dirs.GetSubDiscElements();
                RightStackPanel.Children.Clear();

                string parentPath = dirs.Parent;
                if (dirs.Path != Directory.GetDirectoryRoot(dirs.Path))
                {
                    MyDir Parent = new MyDir(parentPath);
                    ParentDirectoryView parentUser = new ParentDirectoryView(Parent);
                    parentUser.GetNewViewEvent += MainWindow3;
                    RightStackPanel.Children.Add(parentUser);
                }


                foreach (DiscElements discElement in discElements)
                {
                    DiscElementsView something = new DiscElementsView(discElement);

                    RightStackPanel.Children.Add(something);

                    if (discElement is MyDir)
                    {
                        something.GetNewViewEvent += MainWindow3;
                    }
                }
            }
            catch (UnauthorizedAccessException)
            {
                MessageBox.Show("You don't have an access!!!");
            }
        }
Beispiel #2
0
        private void RefreshFilesListR()
        {
            MyDir myDirectory = new MyDir(pathRight);

            RightStackPanel.Children.Clear();

            string parentPath = myDirectory.Parent;

            if (myDirectory.Path != Directory.GetDirectoryRoot(myDirectory.Path))
            {
                MyDir Parent = new MyDir(parentPath);
                ParentDirectoryView parentUser = new ParentDirectoryView(Parent);
                parentUser.GetNewViewEvent += MainWindow3;
                RightStackPanel.Children.Add(parentUser);
            }

            List <DiscElements> subElements = myDirectory.GetSubDiscElements();

            foreach (DiscElements discElement in subElements)
            {
                DiscElementsView discElementView = new DiscElementsView(discElement);

                RightStackPanel.Children.Add(discElementView);

                discElementView.GetNewViewEvent += MainWindow3;
            }
        }