예제 #1
0
 private void cmdAddExcelStorage_Click(object sender, RoutedEventArgs e)
 {
     string val = "Storage_" + (grdStorages.Items.Count + 1);
     if (DotNetSiemensPLCToolBoxLibrary.General.InputBox.Show("Storage-Name", "Name of the Storage", ref val) == DialogResult.OK)
     {
         foreach (var tmp in ProtokollerConfiguration.ActualConfigInstance.Storages)
         {
             if (tmp.Name.ToLower().Trim() == val.ToLower().Trim())
             {
                 MessageBox.Show("A Storage with this Name already Exists!", "Error", MessageBoxButton.OK, MessageBoxImage.Error);
                 return;
             }
         }
         ExcelConfig storage = new ExcelConfig() {Name = val};
         ProtokollerConfiguration.ActualConfigInstance.Storages.Add(storage);
     }
 }
 public override void Connect_To_Database(StorageConfig config)
 {                        
     myConfig = config as ExcelConfig;            
     if (myConfig == null)
         throw new Exception("Database Config is NULL");
 }