void child_Status(object text) { // TODO: neki kurac sam ovdje pijan radio if (text != null) { tssStatus.Text = (string)text; Application.DoEvents(); JobProgress.Write((string)text); } else { JobProgress.Ready(); } }
public void Run_Counter(int counter) { string templateVariable; string templateHeader; string templateBody; string templateFooter; JobProgress.Start(); // Reset all setings on RowCollections objects outputMenagerSettings.rowCollectionMenager.ResetSettings(); ReplaceTagsOnce(); for (int i = 0; i < counter; i++) { // increment row counter outputMenagerSettings.rowCollectionMenager.ActiveObjectInstance.RowCounter++; templateVariable = tagsReplace.ReplaceTags(outputMenagerSettings.sourceTemplateVariables, null); templateHeader = tagsReplace.ReplaceTags(outputMenagerSettings.sourceTemplateHeader, null); templateBody = tagsReplace.ReplaceTags(outputMenagerSettings.sourceTemplateBody, null); templateFooter = tagsReplace.ReplaceTags(outputMenagerSettings.sourceTemplateFooter, null); if (outputMenagerSettings.destinationType == OutputMenagerSettings.DestinationType.File) { this.DestinationFile(templateHeader, templateBody, templateFooter, null, i, counter); } else if (outputMenagerSettings.destinationType == OutputMenagerSettings.DestinationType.Notepad) { this.DestinationNotepad(templateHeader, templateBody, templateFooter, i, counter); } else if (outputMenagerSettings.destinationType == OutputMenagerSettings.DestinationType.DataObjectCompareStrings) { this.DestinationObjectData_CompareStrings(templateHeader, templateBody, templateFooter, null, i, counter); } System.Windows.Forms.Application.DoEvents(); //JobProgress.Write("Radim ...." + i ); } // Close stream writer object if (sw != null) { sw.Close(); } JobProgress.Ready(); }
private void LoadXML(string xmlFile) { ModuleLog.Write(xmlFile, this, "LoadXML", ModuleLog.LogType.DEBUG); if (string.Empty != xmlFile) { //FileInfo fInfo = new FileInfo(xmlFile); //DirectoryInfo dInfo = new DirectoryInfo(string.Concat(fInfo.Directory.FullName, "/", "icons/")); //if (dInfo.Exists) //{ // JobStatus.Write("Loading images.."); // imageList1.Images.Clear(); // FileInfo[] imgList = dInfo.GetFiles("*.gif"); // foreach (FileInfo file in imgList) // { // Image image = Image.FromFile(file.FullName); // imageList1.Images.Add("icons/" + file.Name, image); // } // treeView1.ImageList = imageList1; //} //JobStatus.Write("Opening xml..."); xmlDoc = new XmlDocument(); try { TreeNode rootNode = new TreeNode("Root"); xmlDoc.Load(xmlFile); LoadXMLChild(rootNode, xmlDoc.SelectSingleNode("tags")); treeView1.Nodes.Add(rootNode); //LoadActions(); } catch (XmlException err) { //SetStatus("Error opening xml file"); MessageBox.Show(err.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } catch (Exception e) { ModuleLog.Write(e, this, "LoadXML", ModuleLog.LogType.ERROR, false); } JobProgress.Ready(); } }