Ejemplo n.º 1
0
        internal void showBackupTreeView(BackupRecord backupRecord)
        {
            Application.Current.Dispatcher.Invoke(new Action(() =>
            {
                //show loading
                window.BackupViewProgressBar.Visibility = Visibility.Visible;

                window.DataContext = ItemProvider.GetItems(backupRecord, @"\");

                //hide loading
                window.BackupViewProgressBar.Visibility = Visibility.Hidden;
            }));
        }
Ejemplo n.º 2
0
        public static List <Item> GetItems(BackupRecord br, string path)
        {
            var items = new List <Item>();


            foreach (var directory in br.GetDirectories(path))
            {
                DirectoryItem item;
                if (path.Equals(@"\") || path.Length <= 0)   //fix when path="\"
                {
                    item = new DirectoryItem
                    {
                        ItemName    = directory.ItemName,
                        ItemPath    = directory.ItemPath,
                        ItemChecked = false,
                        Items       = GetItems(br, directory.ItemPath + directory.ItemName)
                    };
                }
                else
                {
                    item = new DirectoryItem
                    {
                        ItemName    = directory.ItemName,
                        ItemPath    = directory.ItemPath,
                        ItemChecked = false,
                        Items       = GetItems(br, directory.ItemPath + @"\" + directory.ItemName)
                    };
                }


                items.Add(item);
            }


            foreach (FileItem file in br.GetFiles(path))
            {
                FileItem item = new FileItem
                {
                    ItemName    = file.ItemName,
                    ItemPath    = file.ItemPath,
                    ItemChecked = false,
                    FileInfo    = file.FileInfo
                };


                items.Add(item);
            }


            return(items);
        }
Ejemplo n.º 3
0
        public BackupListItem(BackupRecord backupRecord, MainWindow window, bool advanced)
        {
            this.backupRecord = backupRecord;
            this.BackupDate   = "Backup " + backupRecord.getDateString();
            this.BackupTime   = backupRecord.getTimeString();
            this.window       = window;
            this.IsAdvanced   = advanced;

            this.Cursor = Cursors.Hand;


            //Backup dialog confirm settings
            backupDialogSettings = new MetroDialogSettings();
            backupDialogSettings.NegativeButtonText = "Annulla";
        }