예제 #1
0
        private static Scripts.IExportStep CreateExportStep(XmlNode exportNode)
        {
            System.Diagnostics.Debug.Assert(exportNode.Name.Equals("export"));
            string type = exportNode.Attributes["type"].Value;

            Scripts.IExportStep export = null;
            if (type.Equals("params"))
            {
                string filename = exportNode.Attributes["name"].Value;
                export = new Scripts.ParamsExportStep(filename);
            }
            else
            {
                throw new System.ArgumentException("The export type " + type + " is invalid");
            }

            foreach (XmlNode fieldNode in exportNode.ChildNodes)
            {
                export.SubTerms.Add(CreateExportSubStep(fieldNode));
            }

            return(export);
        }
        private static Scripts.IExportStep CreateExportStep(XmlNode exportNode)
        {
            System.Diagnostics.Debug.Assert(exportNode.Name.Equals("export"));
            string type = exportNode.Attributes["type"].Value;

            Scripts.IExportStep export = null;
            if (type.Equals("params"))
            {
                string filename = exportNode.Attributes["name"].Value;
                export = new Scripts.ParamsExportStep(filename);
            }
            else
            {
                throw new System.ArgumentException("The export type " + type + " is invalid");
            }

            foreach (XmlNode fieldNode in exportNode.ChildNodes)
                export.SubTerms.Add (CreateExportSubStep (fieldNode));

            return export;
        }