private void taskMan_DoWork(object sender, DoWorkEventArgs e) { string[] filePaths = (string[])e.Argument; foreach (string fileName in filePaths) { string content = System.IO.File.ReadAllText(fileName); RefScrAutoScrContainer addMe = new RefScrAutoScrContainer(); addMe.Script = new ReflectionScript(); addMe.Script.setCode(content); if (addMe.Script.getNotRuntimeErrorCount() == 0) { addMe.Label = addMe.Script.SetupStringValue(ReflectionScript.SETUP_LABEL); addMe.Description = addMe.Script.SetupStringValue(ReflectionScript.SETUP_DESC); if (this.AllScripts && addMe.Label == null) { addMe.Label = System.IO.Path.GetFileNameWithoutExtension(fileName); } if (addMe.Label != null) { //this.scriptCollection.Add(addMe); taskMan.ReportProgress(1, addMe); } } } }
private void taskMan_ProgressChanged(object sender, ProgressChangedEventArgs e) { RefScrAutoScrContainer addMe = (RefScrAutoScrContainer)e.UserState; this.scriptCollection.Add(addMe); }