Example #1
0
        public static CNCMachineCode Open()
        {
            if (xmlFileName != null && xmlFileName != "" && System.IO.File.Exists(xmlFileName))
            {
                var            xmls = new FileIOLib.XmlSerializer <CNCMachineCode>();
                CNCMachineCode mc   = xmls.OpenXML(xmlFileName);
                if (mc == null)
                {
                    return(new CNCMachineCode());
                }
                else
                {
                    return(mc);
                }
            }

            return(new CNCMachineCode());
        }
 public static MachineSettings Open(string fileName)
 {
     if (fileName != null && fileName != "" && System.IO.File.Exists(fileName))
     {
         var             xmls = new FileIOLib.XmlSerializer <MachineSettings>();
         MachineSettings ms   = xmls.OpenXML(fileName);
         if (ms == null)
         {
             return(new MachineSettings());
         }
         else
         {
             return(ms);
         }
     }
     else
     {
         return(new MachineSettings());
     }
 }
Example #3
0
        public static void Save(CNCMachineCode obj)
        {
            var xmls = new FileIOLib.XmlSerializer <CNCMachineCode>();

            xmls.SaveXML(obj, xmlFileName);
        }
        public static void Save(MachineSettings obj, string fileName)
        {
            var xmls = new FileIOLib.XmlSerializer <MachineSettings>();

            xmls.SaveXML(obj, fileName);
        }