Esempio n. 1
0
        static void Main()
        {
            ProgramDataFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Tag2Space.xml");
            ProgramData     = new _ProgramData();
            serializer      = new XmlSerializer(typeof(_ProgramData));

            ReadProgramData();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainWindow());

            SaveProgramData();
        }
Esempio n. 2
0
        public static bool ReadProgramData()
        {
            bool       ret    = true;
            FileStream stream = null;

            try {
                stream      = new FileStream(ProgramDataFile, FileMode.Open);
                ProgramData = (_ProgramData)serializer.Deserialize(stream);
            }
            catch (Exception ex) {
                ret = false;
            }
            finally {
                if (stream != null)
                {
                    stream.Close();
                }
            }

            return(ret);
        }