Esempio n. 1
0
        public void reportSearchProgress(string file, bool isSearchFile)
        {
            if(!this.evermoreModel.SearchPage.Dispatcher.CheckAccess()) 
            {
                this.evermoreModel.SearchPage.Dispatcher.BeginInvoke(
                    new Action<string, bool> (reportSearchProgress), new object[] { file, isSearchFile });
                return;
            }
            
            if (isSearchFile)
            {
                this.evermoreModel.IsFileFound = true;
                this.evermoreModel.SearchPage.FoundFilesComboBox.Items.Add(file);
                this.evermoreModel.FileFoundCount += 1;
                
                // DO not riase toast if more than 10 files have already been found - UI hang issue
                if (this.evermoreModel.FileFoundCount <= 10)
                {
                    ToastWindow toast = new ToastWindow(this, "[" + this.evermoreModel.FileFoundCount
                        + "] " + "New file found!\n" + file);

                    toast.RaiseToast();
                    Debug.WriteLine("[Success] Received file : " + file);
                }
            }
            else
            {
                this.evermoreModel.SearchProgressLabelContent = "Looking in " + file;
                Debug.WriteLine("[Reporting] Processing dir : " + file);
            }
        }