예제 #1
0
 private void saveSettingItem(SettingItem item)
 {
     try
     {
         var dbItem = getSettingItem(item.Key);
         if(dbItem == null)
         {
             dbContext.SettingItems.Add(item);
         }
         else
         {
             dbItem.Value = item.Value;
         }
         dbContext.SaveChanges();
     }
     catch (Exception r)
     {
         MessageBox.Show(r.InnerException.Message);
     }
 }
예제 #2
0
 private void loadSettings()
 {
     viewSetting = getSettingItem("view.viewmode");
     if (viewSetting == null)
     {
         viewSetting = new SettingItem { Key = "view.viewmode", Value="TV"};
     }
     this.commandsList.Tag = viewSetting.Value;
 }