public void updateSettingList() { TaskSettingsList.Clear(); foreach (TaskPanel tmpPanel in TaskPanels) { foreach (TaskSettingItem tmpSetting in tmpPanel.controlObject.GetSettings()) { TaskSettingsList.Add(tmpSetting); } } }
public override bool ValidateTask() { if (TaskSettingsList.Find(o => o.Group == "Model" && o.Setting == "Type1").Checked() == false && TaskSettingsList.Find(o => o.Group == "Model" && o.Setting == "Type2").Checked() == false) { MessageBox.Show(RMString.GetString("SErrorNoModelType"), RMString.GetString("SError")); return(false); } if (TaskSettingsList.Find(o => o.Group == "Model" && o.Setting == "Type1").Checked()) { if (TaskSettingsList.Exists(o => o.Group == "Variables" && o.Setting == "RoleTargetResponse") == false) { MessageBox.Show(RMString.GetString("SErrorNoTarget"), RMString.GetString("SError")); return(false); } else if (TaskSettingsList.Exists(o => o.Group == "Variables" && o.Setting == "RoleTargetCensor") && TaskSettingsList.Find(o => o.Group == "Model" && o.Setting == "Censors").Value == "") { MessageBox.Show(RMString.GetString("SErrorNoCensor"), RMString.GetString("SError")); return(false); } } if (TaskSettingsList.Find(o => o.Group == "Model" && o.Setting == "Type2").Checked()) { if (TaskSettingsList.Exists(o => o.Group == "Variables" && o.Setting == "RoleTargetLower") == false) { MessageBox.Show(RMString.GetString("SErrorNoTargetLower"), RMString.GetString("SError")); return(false); } else if (TaskSettingsList.Exists(o => o.Group == "Variables" && o.Setting == "RoleTargetUpper") == false) { MessageBox.Show(RMString.GetString("SErrorNoTargetUpper"), RMString.GetString("SError")); return(false); } } return(true); }
public void FromXml(string xml) { XmlDocument doc = new XmlDocument(); try { TaskSettingsList.Clear(); doc.LoadXml(xml); XmlElement XmlTask = doc[this.TaskXmlName]; foreach (XmlElement XmlSetting in XmlTask) { TaskSettingItem SettingItem = new TaskSettingItem(XmlSetting.GetAttribute("Group"), XmlSetting.GetAttribute("Setting"), XmlSetting.GetAttribute("Value")); TaskSettingsList.Add(SettingItem); } } catch (XmlException) { } catch (Exception) { } }