コード例 #1
0
        void LoadPersistedConfig()
        {
            try
            {
                if (String.IsNullOrEmpty(PersistFilename))
                {
                    //Console.WriteLine("trying to load the persisted file");
                    PersistFilename = Utils.GetFile();
                }
                if (PersistFilename == null)
                {
                    return;
                }

                object loadedobject = PersistSettings.Load(PersistFilename);
                if (loadedobject != null)
                {
                    LiveCollection = (ObservableCollection <ISessionColumn>)loadedobject;
                }
                else
                {
                    PersistFilename = string.Empty;
                    return;
                }
            }
            catch (Exception e)
            {
                MessageBox.Show("There was a problem loadeing the configuration: " + e.Message);
            }
            finally
            {
            }
        }
コード例 #2
0
 void SaveConfig()
 {
     PersistSettings.Save(LiveCollection);
 }