예제 #1
0
        public static GenerateProject Load(String fileName)
        {
            StreamReader  fs;
            XmlSerializer ConSerializer = new XmlSerializer(typeof(GenerateProject));

            fs = new StreamReader(fileName);
            GenerateProject s = ((GenerateProject)(ConSerializer.Deserialize(fs)));

            fs.Close();
            if (s == null)
            {
                s             = new GenerateProject();
                s.Generations = new List <Generation>();
                s.Properties  = new List <ProjectProperty>();
            }
            return(s);
        }
예제 #2
0
        public static GenerateProject Initialize(String fileName)
        {
            GenerateProject result;

            try
            {
                result = Load(fileName);
            }

            catch
            {
                result             = new GenerateProject();
                result.Generations = new List <Generation>();
            }

            return(result);
        }