Beispiel #1
0
        /// <summary>
        /// Constructeur Complet.
        /// </summary>
        public static void Save(UserConfiguration objectToSave, string filename)
        {
            IsolatedStorageFileStream stream = Storage.CreateFile(filename);

            XmlSerializer xml = new XmlSerializer(objectToSave.GetType());
            xml.Serialize(stream, objectToSave);

            stream.Close();
            stream.Dispose();
        }
Beispiel #2
0
 public static WindowConfiguration getWindowConfiguration(UserConfiguration uc, String username, String key)
 {
     WindowConfiguration wc = null;
     try
     {
         if (uc != null)
             wc = uc.GetApplicationconfigurationFromUsername(username).WindowsConfiguration[key];
     }
     catch (KeyNotFoundException) { }
     return wc;
 }
Beispiel #3
0
        public static UserConfiguration Load(string filename)
        {
            UserConfiguration configuration = new UserConfiguration();

            if (Storage.FileExists(filename))
            {
                IsolatedStorageFileStream stream = Storage.OpenFile(filename, FileMode.Open);
                XmlSerializer xml = new XmlSerializer(typeof(UserConfiguration));
                configuration = xml.Deserialize(stream) as UserConfiguration;
                stream.Close();
                stream.Dispose();
            }

            return configuration;
        }
Beispiel #4
0
 private void Window_Initialized(object sender, EventArgs e)
 {
     UserConfiguration = StorageUtil.Load(AppResources.CONFIGURATION_FILENAME);
     var wc = getWindowConfiguration(UserConfiguration, App._currentUser, ToString());
     setWindowConfiguration(wc);
 }