public WFState(XmlNode node, WFSrc wfsrc, WFTarget wftarget, string assemblycache) { this.State = new KRSrcWorkflow.WFState(string.Empty); this.Target = null; this.Mappings = new List<WFMapping>(); if (node == null) throw new Exception("Input node is null"); XmlNode value = node.Attributes.GetNamedItem("value"); if((value == null) || (value.Value == string.Empty)) throw new Exception("No value attribute in node"); this.State.Value = value.Value; XmlNode target = node.Attributes.GetNamedItem("target"); if ((wftarget == null) && ((value == null) || (value.Value == string.Empty))) throw new Exception("No target attribute in node"); if (target != null) { try { wftarget = new WFTarget(target.Value, assemblycache); } catch (Exception ex) { throw new Exception("Create WFTarget failed.", ex); } this.Target = wftarget; } foreach (XmlNode mappingnode in node.SelectNodes("mapping")) this.Mappings.Add(new WFMapping(mappingnode, wfsrc.AssemblyType, wftarget.AssemblyType)); }
public WFState(XmlNode node, WFSrc wfsrc, WFTarget wftarget, string assemblycache) { this.State = new KRSrcWorkflow.WFState(string.Empty); this.Target = null; this.Mappings = new List <WFMapping>(); if (node == null) { throw new Exception("Input node is null"); } XmlNode value = node.Attributes.GetNamedItem("value"); if ((value == null) || (value.Value == string.Empty)) { throw new Exception("No value attribute in node"); } this.State.Value = value.Value; XmlNode target = node.Attributes.GetNamedItem("target"); if ((wftarget == null) && ((value == null) || (value.Value == string.Empty))) { throw new Exception("No target attribute in node"); } if (target != null) { try { wftarget = new WFTarget(target.Value, assemblycache); } catch (Exception ex) { throw new Exception("Create WFTarget failed.", ex); } this.Target = wftarget; } foreach (XmlNode mappingnode in node.SelectNodes("mapping")) { this.Mappings.Add(new WFMapping(mappingnode, wfsrc.AssemblyType, wftarget.AssemblyType)); } }
public WFState(XmlNode node, WFSrc wfsrc, WFTarget wftarget) : this(node, wfsrc, wftarget, string.Empty) { }
public WFState(XmlNode node, WFSrc wfsrc) : this(node, wfsrc, null) { }