Esempio n. 1
0
        public void ArchiveInput(ioInput input, DirectoryInfo targetFolder = null)
        {
            bool archivingWithSameName = false;
            if (targetFolder == null) {
                targetFolder = rootFolder;
                archivingWithSameName = true; //Handling the edge case where user clicked "Archive with same name", i.e. Creating a new folder in the root with the same name as the folder being archived (basically just moving a folder from somewhere to ark root).
            }
            archiveItems(input.FSOPaths, targetFolder);

            string searchFilter = "";
            if (archivingWithSameName)
            {
                DirectoryInfo di = new DirectoryInfo(input.FSOPaths[0]);

                string sameNameNewPath = System.IO.Path.Combine(rootFolder.FullName, di.Name);
                DirectoryInfo sameNameNewPathDI = new DirectoryInfo(sameNameNewPath);
                allArchiveItems.Add(new ArchiveItem(sameNameNewPathDI));
                searchFilter = sameNameNewPathDI.Name;
            }
            else
            {
                searchFilter = targetFolder.Name;
            }

            SearchFilter = searchFilter;
        }
Esempio n. 2
0
        public ViewModelSearchPage(ViewModelHelp vmHelp, ViewModelArchiveItems vmArchiveItems, ioInput input = null)
        {
            App.CurrentVMHelp = vmHelp;
            vmArchive = vmArchiveItems;

            if (input != null)
            {
                CurrentInput = input;
            }
        }
Esempio n. 3
0
 public void AddInput(ioInput input)
 {
     if (CurrentInput == null)
     {
         CurrentInput = input;
     }
     else
     {
         CurrentInput.AddPaths(input.FSOPaths);
     }
 }
Esempio n. 4
0
        public pageSearch(ioInput input = null)
        {
            InitializeComponent();
            vmSearchPage = new ViewModelSearchPage(vmHelp, vmArchive, input);

            this.DataContext = vmSearchPage;

            Dispatcher.BeginInvoke(DispatcherPriority.Input, new Action(delegate ()
            {
                txtSearch.Focus();
                Keyboard.Focus(txtSearch);
            }));
        }