public void DoSearch()
        {
            UpdateRecentValues();

            Progress.Max         = 10000;
            Progress.JobProgress = 0;
            Progress.JobStatus   = JobStatus.inProgress;

            SCWrapper scWrp            = new SCWrapper(this.teamExplorer);
            Wildcard  fileNameWildCard = new Wildcard(this.FileNameFilter);

            this.FoundFiles = new ObservableCollection <SCFile>();

            CancelCallbackNotify notify = new CancelCallbackNotify();

            notify._delegate = DispatchUpdateStatus;
            notify.start     = 0;
            notify.range     = Progress.Max;

            SearchCondition s = new SearchCondition(this.SearchText, this.isCaseSensitive, this.useRegExp);

            List <SCFolder> foldersToSearch = new List <SCFolder>();

            foreach (SCFolder fld in RootFolders)
            {
                foldersToSearch.Add(fld);
            }

            scWrp.SearchForFileContent(foldersToSearch, fileNameWildCard, s, this.SearchHistory, notify);

            Progress.JobStatus = JobStatus.notStarted;
        }
        public SCFolder LoadRootFolder()
        {
            SCFolder fldDummy = new SCFolder {
                FolderPath = @"DummyRoot"
            };

            if (teamExplorer != null)
            {
                SCFolder fld = new SCFolder {
                    FolderPath = @"$/" + teamExplorer.tpCollection.Name
                };
                fldDummy.Folders.Add(fld);

                SCWrapper scWrap = new SCWrapper(teamExplorer);

                fld.Folders.AddRange(scWrap.GetRootFolders());
            }
            else
            {
                fldDummy.Folders.Add(new SCFolder {
                    FolderPath = "Hej"
                });
                fldDummy.Folders.Add(new SCFolder {
                    FolderPath = "Hej då"
                });
            }

            return(fldDummy);
        }
        internal void ShowFile(SCFile file)
        {
            //Download to temp
            string    tempFileName = string.Format(@"{0}{1}_{2}.{3}", Path.GetTempPath(), file.FileNameWithoutExt, file.ChangesetId, file.FileExt);
            SCWrapper scWrp        = new SCWrapper(this.teamExplorer);

            scWrp.DownLoadFile(tempFileName, file.ItemId, file.ChangesetId);

            // Open Document
            int lineNo = Convert.ToInt32(file.Comment);

            VSIntegration.OpenDocumentAndNavigateTo(tempFileName, lineNo, 0);
        }
Esempio n. 4
0
        public void DoSearch()
        {
            CallbackDelegate callback = new CallbackDelegate(UpdateStatus);

            SCWrapper scWrp            = new SCWrapper(vm.teamExplorer);
            Wildcard  fileNameWildCard = new Wildcard(vm.FileNameFilter);

            for (int i = 0; i < vm.RootFolder.Folders[0].Folders.Count; i++)
            {
                SCFolder fld = vm.RootFolder.Folders[0].Folders[i];
                Dispatcher.Invoke(callback, System.Windows.Threading.DispatcherPriority.Background, new object[] { i * 100, fld.FolderPath });

                vm.AddFoundFiles(scWrp.SearchForFile(fld, fileNameWildCard, vm.MinFileSizeInBytes()));
            }

            Dispatcher.Invoke(callback, System.Windows.Threading.DispatcherPriority.Background, new object[] { 100 * vm.RootFolder.Folders[0].Folders.Count, "Done" });
        }
        public void DoCalcTree()
        {
            CallbackDelegate callback = new CallbackDelegate(UpdateStatus);

            SCWrapper       scWrp       = new SCWrapper(vm.teamExplorer);
            List <SCFolder> selectedFld = vm.RootFolder.Folders[0].Folders.FindAll(delegate(SCFolder f) { return(f.IsSelected); });

            for (int i = 0; i < selectedFld.Count; i++)
            {
                SCFolder fld = selectedFld[i];
                Dispatcher.Invoke(callback, System.Windows.Threading.DispatcherPriority.Background, new object[] { i * 100, fld.FolderPath });

                scWrp.CalcSize(ref fld);
                fld.SetInclusiveSize();
            }

            vm.RootFolder.Folders[0].SetInclusiveSize();
            Dispatcher.Invoke(callback, System.Windows.Threading.DispatcherPriority.Background, new object[] { 100 * selectedFld.Count, "Done" });
        }