예제 #1
0
        public static string GetFileStream(this Inputer inputer, string xsdFile)
        {
            inputer.ValidateFile(xsdFile);
            var file = File.ReadAllText(xsdFile);

            return(file.Replace("\n", "").Replace("\t", "").Replace("\r", ""));
        }
예제 #2
0
        public static void ValidateFile(this Inputer inputer, string xsdFile)
        {
            if (!File.Exists(xsdFile))
            {
                throw new ArgumentNullException("The input file is not exist!");
            }

            string extendString = new FileInfo(xsdFile).Extension;

            if (!string.Equals(extendString, inputer.Extend))
            {
                throw new ArgumentException("Please input .xsd file!");
            }
        }