public Release(ReleaseCommand command) { Command = command ?? throw new ArgumentNullException(nameof(command)); T config <T>(T obj) { CONF.Configure(obj, ""); CONF.Configure(obj); Command.Configure(obj, ""); Command.Configure(obj); return(obj); } var info = config(this); var codeBase = new CodeBase(info.Repository); foreach (var action in Actions) { config(action); action.CodeBase = codeBase; action.Solution = codeBase.Solution; action.Work(); } }
private void AddProject(CONF.XmlLoad X) { Project P = new Project(ProjectPath); string File = X.GetAttribute("path"); if (P.Load(ProjectPath + "\\" + File)) { ProjectList.Add(P); } else { Log.WriteLine(String.Format("Could not load project file: {0:s}", File)); } }
public List <CONF> GetCONF_OfCluster(string cluster) { List <CONF> list = new List <CONF>(); CONF item; Dictionary <string, object> parameters = new Dictionary <string, object>(); parameters.Add("@cluster", cluster); SqlDataReader dr = executeReader("SELECT MetaItemSource, MetaItemDestination, Confident FROM [RS].CONFIDENT_MATRIX WHERE CLusterID = @cluster", parameters); while (dr.Read()) { item = new CONF(); item.ClusterID = cluster; item.MetaItemSource = dr[0].ToString(); item.MetaItemDestination = dr[1].ToString(); item.Confident = Convert.ToDouble(dr[2]); list.Add(item); } dr.Close(); return(list); }
private Options.OptionText LoadText(string Name, CONF.XmlLoad X) { var O = new Options.OptionText(Name); var Def = X.GetAttribute("default"); if (Def != null) O.Default = Def; var N = X.GetAttribute("name"); if (N != null) O.ParamName = N; return O; }
private void LoadSupportedTypes(CONF.XmlLoad X) { while (X.Read()) { switch (X.ElementName) { case "type": ControllerTypes.Add(X.GetAttribute("value")); break; } } X.Close(); }
private void LoadOptions(CONF.XmlLoad X) { while (X.Read()) { switch (X.ElementName) { case "list": Ops.Add(LoadList(X.GetAttribute("label"), X.GetSubtree())); break; case "text": Ops.Add(LoadText(X.GetAttribute("label"), X)); break; } } X.Close(); }
private void LoadOption(Options.OptionList O, CONF.XmlLoad Base, CONF.XmlLoad X) { var I = new Options.OptionListItem(Base.GetAttribute("label")); I.Default = (Base.GetAttribute("default") != null); while (X.Read()) { switch (X.ElementName) { case "value": string N = X.GetAttribute("name"); string V = X.GetAttribute("val"); if(N != null) I.setString(N, V); break; } } X.Close(); O.AddItem(I); }
private Options.OptionList LoadList(string Name, CONF.XmlLoad X) { var O = new Options.OptionList(Name); while (X.Read()) { switch (X.ElementName) { case "option": LoadOption(O, X, X.GetSubtree()); break; } } X.Close(); return O; }
private void LoadCustomActions(CONF.XmlLoad X) { while (X.Read()) { ToolAction A = LoadAction(X.GetSubtree()); A.Name = X.ElementName; taCustom.Add(A); } X.Close(); }
private void LoadActions(CONF.XmlLoad X) { while (X.Read()) { switch (X.ElementName) { case "erase": taErase = LoadAction(X.GetSubtree()); break; case "woption": taProgramOption = LoadAction(X.GetSubtree()); break; case "wflash": taProgramFlash = LoadAction(X.GetSubtree()); break; case "wdata": taProgramData = LoadAction(X.GetSubtree()); break; case "vflash": taVerifyFlash = LoadAction(X.GetSubtree()); break; case "vdata": taVerifyData = LoadAction(X.GetSubtree()); break; case "lock": taLock = LoadAction(X.GetSubtree()); break; case "launch": taLaunch = LoadAction(X.GetSubtree()); break; case "convert": taConvert = LoadAction(X.GetSubtree()); break; default: { ToolAction A = LoadAction(X.GetSubtree()); A.Name = X.ElementName; taCustom.Add(A); } break; } } X.Close(); }
private ToolAction LoadAction(CONF.XmlLoad X) { ToolAction A = new ToolAction(); while (X.Read()) { switch (X.ElementName) { case "command": A.Command = X.GetAttribute("value"); break; case "toolpath": A.CustomToolPath = X.GetAttribute("value"); break; case "params": { CONF.XmlLoad Subtree = X.GetSubtree(); while (Subtree.Read()) { var Name = Subtree.ElementName; var Def = Subtree.GetAttribute("default") ?? ""; A.Defaults.setString(Name, Def); } Subtree.Close(); } break; case "error": { CONF.XmlLoad Subtree = X.GetSubtree(); while (Subtree.Read()) { switch (Subtree.ElementName) { case "string": A.ErrorMask.Add(Subtree.GetAttribute("value")); break; } } Subtree.Close(); } break; case "internal": { CONF.XmlLoad Subtree = X.GetSubtree(); while (Subtree.Read()) { switch (Subtree.ElementName) { case "string": A.Write.Add(Subtree.GetAttribute("value")); break; } } Subtree.Close(); } break; } } return A; }
private void LoadActions(Script S, CONF.XmlLoad X) { while (X.Read()) { string Value = X.GetAttribute("value"); string Comment = X.GetAttribute("comment"); Tool.Options.OptionListItem Params = new Tool.Options.OptionListItem("values"); string[] Args = X.GetAttributeNames(); for (int i = 0; i < Args.Length; i++) { var N = Args[i]; if ((N.CompareTo("value") == 0) || (N.CompareTo("comment") == 0)) continue; Params.setString(N, X.GetAttribute(N)); } switch (X.ElementName) { case "erase": S.Actions.Add(new ScriptAction("erase", Value, Comment, Params)); break; case "option": S.Actions.Add(new ScriptAction("option", Value, Comment, Params)); break; case "wflash": S.Actions.Add(new ScriptAction("wflash", Value, Comment, Params)); break; case "wdata": S.Actions.Add(new ScriptAction("wdata", Value, Comment, Params)); break; case "vflash": S.Actions.Add(new ScriptAction("vflash", Value, Comment, Params)); break; case "vdata": S.Actions.Add(new ScriptAction("vdata", Value, Comment, Params)); break; case "external": S.Actions.Add(new ScriptAction("external", Value, Comment, Params)); break; case "lock": S.Actions.Add(new ScriptAction("lock", Value, Comment, Params)); break; case "launch": S.Actions.Add(new ScriptAction("launch", Value, Comment, Params)); break; case "copy": S.Actions.Add(new ScriptAction("copy", Value, Comment, Params)); break; case "copyto": S.Actions.Add(new ScriptAction("copyto", Value, Comment, Params)); break; case "convert": S.Actions.Add(new ScriptAction("convert", Value, Comment, Params)); break; default: S.Actions.Add(new ScriptAction(X.ElementName, Value, Comment, Params)); break; } } X.Close(); }
private void LoadScript(CONF.XmlLoad X) { Script S = new Script(); Scripts.Add(S); if (X.HasAttribute("version")) S.Version = X.GetAttribute("version"); while (X.Read()) { switch (X.ElementName) { case "name": S.Name = X.GetAttribute("value"); break; case "device": S.Device = X.GetAttribute("value"); break; case "cathegory": S.Cathegory = X.GetIntAttribute("value"); break; case "input": S.Input = X.GetAttribute("value"); S.Default = X.GetAttribute("default"); break; case "steps": LoadActions(S, X.GetSubtree()); break; case "default": S.DefaultScript = true; break; case "autorun": S.Autorun = true; break; case "old": S.Old = true; break; } } X.Close(); }