Пример #1
0
 //просмотр конфигурации устройства
 private void openConfigurationToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (listViewConfig.SelectedItems.Count != 0)
     {
         var item     = listViewConfig.SelectedItems[0];
         int configId = Int32.Parse(item.SubItems[0].Text);
         using (context = new RconfigContext())
         {
             var queryConfig = (from c in context.Configs
                                where c.Id == configId
                                select c).FirstOrDefault();
             if (queryConfig != null)
             {
                 Config_Watcher frm    = new Config_Watcher(queryConfig);
                 DialogResult   result = frm.ShowDialog();
                 if (result == DialogResult.OK)
                 {
                     //*******************************
                 }
             }
         }
     }
 }
 //просмотр конфигурации устройства
 private void openConfigurationToolStripMenuItem_Click(object sender, EventArgs e)
 {
     if (listViewConfig.SelectedItems.Count != 0)
     {
         var item = listViewConfig.SelectedItems[0];
         int configId = Int32.Parse(item.SubItems[0].Text);
         using (context = new RconfigContext())
         {
             var queryConfig = (from c in context.Configs
                                where c.Id == configId
                                select c).FirstOrDefault();
             if (queryConfig != null)
             {
                 Config_Watcher frm = new Config_Watcher(queryConfig);
                 DialogResult result = frm.ShowDialog();
                 if (result == DialogResult.OK)
                 {
                     //*******************************
                 }
             }
         }
     }            
 }