// invoked after a successful authentication private void loadWorkflow(XmlDocument workflow_document) { if (this.InvokeRequired) { ConfigureWorkFlowsDelegate del = new ConfigureWorkFlowsDelegate(loadWorkflow); this.Invoke(del, new object[] { workflow_document }); } else { ReportStatus("Processing Workflows"); XmlNode workflow = workflow_document.SelectSingleNode("//select[@name='workflow']"); workflow_combo.Items.Clear(); //workflow_combo.Items.Add(new Workflow("Please Choose Desired Workflow", null, "What workflow do you want ot submit your file to?")); List <Workflow> temp_workflows = new List <Workflow>(); foreach (XmlElement item in workflow.ChildNodes) { string uuid = item.GetAttribute("value"); string description = item.GetAttribute("title"); string name = item.FirstChild.Value; temp_workflows.Add(new Workflow(name, uuid, description)); //workflow_combo.Items.Add(new Workflow(name, uuid, description)); } // check that workflows exist if (temp_workflows.Count == 0) { MessageBox.Show("There are no workflows to add this file to, please make sure you have access to workflows and try again."); forceClose(); return; } else { temp_workflows.Sort(); workflow_combo.Items.Add(new Workflow("Please Choose Desired Workflow", null, "What workflow do you want ot submit your file to?")); workflow_combo.Items.AddRange(temp_workflows.ToArray()); workflow_combo.SelectedIndex = 0; ReportStatus("Ready"); workflow_combo.Enabled = true; } } }
// invoked after a successful authentication private void loadWorkflow(XmlDocument workflow_document) { if (this.InvokeRequired) { ConfigureWorkFlowsDelegate del = new ConfigureWorkFlowsDelegate(loadWorkflow); this.Invoke(del, new object[] { workflow_document }); } else { ReportStatus("Processing Workflows"); XmlNode workflow = workflow_document.SelectSingleNode("//select[@name='workflow']"); workflow_combo.Items.Clear(); //workflow_combo.Items.Add(new Workflow("Please Choose Desired Workflow", null, "What workflow do you want ot submit your file to?")); List<Workflow> temp_workflows = new List<Workflow>(); foreach (XmlElement item in workflow.ChildNodes) { string uuid = item.GetAttribute("value"); string description = item.GetAttribute("title"); string name = item.FirstChild.Value; temp_workflows.Add(new Workflow(name, uuid, description)); //workflow_combo.Items.Add(new Workflow(name, uuid, description)); } // check that workflows exist if (temp_workflows.Count == 0) { MessageBox.Show("There are no workflows to add this file to, please make sure you have access to workflows and try again."); forceClose(); return; } else { temp_workflows.Sort(); workflow_combo.Items.Add(new Workflow("Please Choose Desired Workflow", null, "What workflow do you want ot submit your file to?")); workflow_combo.Items.AddRange(temp_workflows.ToArray()); workflow_combo.SelectedIndex = 0; ReportStatus("Ready"); workflow_combo.Enabled = true; } } }