コード例 #1
0
ファイル: ViewModelArchiveItems.cs プロジェクト: kirsbo/Ark
        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;
        }
コード例 #2
0
ファイル: ViewModelSearchPage.cs プロジェクト: kirsbo/Ark
        public ViewModelSearchPage(ViewModelHelp vmHelp, ViewModelArchiveItems vmArchiveItems, ioInput input = null)
        {
            App.CurrentVMHelp = vmHelp;
            vmArchive = vmArchiveItems;

            if (input != null)
            {
                CurrentInput = input;
            }
        }
コード例 #3
0
ファイル: ViewModelSearchPage.cs プロジェクト: kirsbo/Ark
 public void AddInput(ioInput input)
 {
     if (CurrentInput == null)
     {
         CurrentInput = input;
     }
     else
     {
         CurrentInput.AddPaths(input.FSOPaths);
     }
 }
コード例 #4
0
ファイル: pageSearch.xaml.cs プロジェクト: kirsbo/Ark
        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);
            }));
        }