예제 #1
0
        private void checkedListBox1_ItemCheck(object sender, ItemCheckEventArgs e)
        {
            var value = e.NewValue.ToString() == "Checked" ? true : false;

            hostDataGridViewColumns.GetType()
            .GetProperty(checkedListBox1.Items[e.Index].ToString())
            .SetValue(hostDataGridViewColumns, value);
            dataStorageService.Save(AppConst.VirtualHostColumns, hostDataGridViewColumns);
        }
예제 #2
0
 private void setup()
 {
     try
     {
         var filePath = getFilePath();
         if (filePath == "" || !File.Exists(filePath))
         {
             MessageBox.Show("Vui lòng sửa lại đường dẫn", "Đường dẫn lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error);
         }
         else
         {
             dataStorageService.Save(AppConst.filePathConfig, filePath);
             context = new VirtualHostContext(filePath);
             context.Read();
             setItems();
         }
     }
     catch (Exception ex)
     {
         //throw ex;
     }
 }