コード例 #1
0
        private static void LoadOptions()
        {
            try
            {

                string path = AppDomain.CurrentDomain.BaseDirectory +
                    System.IO.Path.DirectorySeparatorChar +
                    "options.config";

                if (System.IO.File.Exists(path))
                {
                    using (System.IO.Stream s = new System.IO.FileStream(path,
                        System.IO.FileMode.Open,
                        System.IO.FileAccess.Read))
                    {
                        options_ = xs_.Deserialize(s) as MFOptions;
                    }
                }
            }
            catch(Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(ex);

                options_ = new MFOptions();
            }
        }
コード例 #2
0
        private static void LoadOptions()
        {
            try
            {
                string path = AppDomain.CurrentDomain.BaseDirectory +
                              System.IO.Path.DirectorySeparatorChar +
                              "options.config";

                if (System.IO.File.Exists(path))
                {
                    using (System.IO.Stream s = new System.IO.FileStream(path,
                                                                         System.IO.FileMode.Open,
                                                                         System.IO.FileAccess.Read))
                    {
                        options_ = xs_.Deserialize(s) as MFOptions;
                    }
                }
            }
            catch (Exception ex)
            {
                System.Diagnostics.Trace.WriteLine(ex);

                options_ = new MFOptions();
            }
        }