Beispiel #1
0
        public MainForm()
        {
            InitializeComponent();

            // Initialize all local fields
            _preferenceLocations = new PreferenceLocations();
            _globalPreferences = new GlobalPreferences();
            _localPreferences = new LocalPreferences();
        }
Beispiel #2
0
 /**
  * Open GlobalPrefs.js (actual location is coming from LocationPreferences.js)
  * and de-serialize into local field.
  **/
 private void LoadGlobalPreferences()
 {
     using (FileStream fileStream = new FileStream(_preferenceLocations.GlobalPreferenceLocation, FileMode.OpenOrCreate, FileAccess.Read))
     {
         if (fileStream.Length == 0)
             return;
         DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(GlobalPreferences));
         _globalPreferences = serializer.ReadObject(fileStream) as GlobalPreferences;
     }
 }