Example #1
0
        public WFMapping(XmlNode node, Type srctype, Type targettype)
        {
            XmlNode src = node.Attributes.GetNamedItem("src");

            if ((src == null) || (src.Value == string.Empty))
            {
                throw new Exception("No src attribute in node");
            }

            XmlNode target = node.Attributes.GetNamedItem("target");

            if ((target == null) || (target.Value == string.Empty))
            {
                throw new Exception("No target attribute in node");
            }

            try
            {
                this.Src = new WFMappingSrc(src.Value, srctype);
            }
            catch (Exception ex)
            {
                throw new Exception("Create WFMappingSrc failed", ex);
            }

            try
            {
                this.Target = new WFMappingTarget(target.Value, targettype);
            }
            catch (Exception ex)
            {
                throw new Exception("Create WFMappingTarget failed", ex);
            }
        }
Example #2
0
 public WFMapping(string src, Type srctype, string target, Type targettype)
 {
     try
     {
         this.Src    = new WFMappingSrc(src, srctype);
         this.Target = new WFMappingTarget(target, targettype);
     }
     catch (Exception ex)
     {
         throw new Exception("Invalid arguments", ex);
     }
 }