Пример #1
0
 /// <summary>
 ///
 /// </summary>
 private Boolean IsFileHidden(String file, IProject project)
 {
     String[] hiddenPaths = project.GetHiddenPaths();
     foreach (String hiddenPath in hiddenPaths)
     {
         String absHiddenPath = project.GetAbsolutePath(hiddenPath);
         if (Directory.Exists(absHiddenPath) && file.StartsWith(absHiddenPath))
         {
             return(true);
         }
     }
     return(false);
 }
Пример #2
0
 /// <summary>
 /// Refresh the current project parsing all files
 /// </summary>
 private void RefreshProject()
 {
     this.currentPos      = -1;
     this.currentFileName = null;
     if (this.isEnabled && PluginBase.CurrentProject != null)
     {
         this.RefreshEnabled = false;
         // Stop current exploration
         if (this.parseTimer.Enabled)
         {
             this.parseTimer.Stop();
         }
         this.parseTimer.Tag = null;
         if (bgWork != null && bgWork.IsBusy)
         {
             bgWork.CancelAsync();
         }
         IProject           project  = PluginBase.CurrentProject;
         ExplorationContext context  = new ExplorationContext();
         Settings           settings = (Settings)this.pluginMain.Settings;
         context.ExcludedPaths = (String[])settings.ExcludedPaths.Clone();
         context.Directories   = (String[])project.SourcePaths.Clone();
         for (Int32 i = 0; i < context.Directories.Length; i++)
         {
             context.Directories[i] = project.GetAbsolutePath(context.Directories[i]);
         }
         context.HiddenPaths = project.GetHiddenPaths();
         for (Int32 i = 0; i < context.HiddenPaths.Length; i++)
         {
             context.HiddenPaths[i] = project.GetAbsolutePath(context.HiddenPaths[i]);
         }
         GetExtensions();
         bgWork         = new BackgroundWorker();
         context.Worker = bgWork;
         bgWork.WorkerSupportsCancellation = true;
         bgWork.DoWork             += new DoWorkEventHandler(bgWork_DoWork);
         bgWork.RunWorkerCompleted += new RunWorkerCompletedEventHandler(bgWork_RunWorkerCompleted);
         bgWork.RunWorkerAsync(context);
         String message = TextHelper.GetString("Info.Refreshing");
         this.toolStripLabel.Text = message;
     }
 }
Пример #3
0
 /// <summary>
 /// Check if file is hidden in project
 /// </summary>
 private Boolean IsFileHidden(String file, IProject project)
 {
     String[] hiddenPaths = project.GetHiddenPaths();
     foreach (String hiddenPath in hiddenPaths)
     {
         String absHiddenPath = project.GetAbsolutePath(hiddenPath);
         if (Directory.Exists(absHiddenPath) && file.StartsWith(absHiddenPath)) return true;
     }
     return false;
 }