private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     try
     {
         ProtokollerConfiguration.Load();
     }
     catch (Exception ex)
     { }
 }
 private void cmdCopyDataset_Click(object sender, RoutedEventArgs e)
 {
     if (grdDatasets.SelectedItem != null)
     {
         var newDS = ((DatasetConfig)grdDatasets.SelectedItem).Clone();
         newDS.Name += "_" + (ProtokollerConfiguration.ActualConfigInstance.Datasets.Count + 1);
         ProtokollerConfiguration.ActualConfigInstance.Datasets.Add(newDS);
         ProtokollerConfiguration.ReReferenceProtokollerConfiguration(ProtokollerConfiguration.ActualConfigInstance);
     }
 }
        private void cmdLoadFromFile_Click(object sender, RoutedEventArgs e)
        {
            OpenFileDialog dlg = new OpenFileDialog();

            dlg.Filter = "*.conf|*.conf";
            if (dlg.ShowDialog() == true)
            {
                ProtokollerConfiguration.LoadFromFile(dlg.FileName);
            }
        }
        private void cmdSaveToFile_Click(object sender, RoutedEventArgs e)
        {
            SaveFileDialog dlg = new SaveFileDialog();

            dlg.Filter = "*.conf|*.conf";
            if (dlg.ShowDialog() == true)
            {
                ProtokollerConfiguration.SaveToFile(dlg.FileName);
            }
        }
 protected override void OnStart(string[] args)
 {
     try
     {
         ProtokollerConfiguration.Load();
         myInstance = new ProtokollerInstance(ProtokollerConfiguration.ActualConfigInstance);
         myInstance.Start(true);
     }
     catch (Exception ex)
     {
         Logging.LogText("Exception occured! ", ex, Logging.LogLevel.Error);
     }
 }
        public MultiStorage(ProtokollerConfiguration protokollerConfiguration, StorageConfig config, Action <string> NewDataCallback)
        {
            this._protokollerConfiguration = protokollerConfiguration;
            this._newDataCallback          = NewDataCallback;

            storages      = new List <DBBaseClass>();
            this.myConfig = config as MultiStorageConfig;

            foreach (string s in myConfig.StorageList)
            {
                var storCfg = _protokollerConfiguration.Storages.First(x => x.Name == s);
                var stor    = (DBBaseClass)StorageHelper.GetStorage(null, storCfg, RemotingServer.ClientComms.CallNotifyEvent);
                storages.Add(stor);

                storrageConfigs.Add(stor, storCfg);
            }
        }
        protected override void OnStart(string[] args)
        {
            try
            {
                TaskScheduler.UnobservedTaskException      += TaskScheduler_UnobservedTaskException;
                AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;


                ProtokollerConfiguration.Load();
                myInstance = new ProtokollerInstance(ProtokollerConfiguration.ActualConfigInstance);
                myInstance.Start(true);
            }
            catch (Exception ex)
            {
                Logging.LogText("Exception occured! ", ex, Logging.LogLevel.Error);
            }
        }
        public MultiStorage(ProtokollerConfiguration protokollerConfiguration, StorageConfig config, Action<string> NewDataCallback)
        {
            this._protokollerConfiguration = protokollerConfiguration;
            this._newDataCallback = NewDataCallback;

            storages = new List<DBBaseClass>();
            this.myConfig = config as MultiStorageConfig;

            foreach (string s in myConfig.StorageList)
            {
                var storCfg = _protokollerConfiguration.Storages.First(x => x.Name == s);
                var stor = (DBBaseClass)StorageHelper.GetStorage(null, storCfg, RemotingServer.ClientComms.CallNotifyEvent);
                storages.Add(stor);

                storrageConfigs.Add(stor, storCfg);

            }   
        }
 public static IDBInterface GetStorage(ProtokollerConfiguration config, StorageConfig cfg, Action <string> NewDataCallback)
 {
     if (cfg is SQLiteConfig)
     {
         return(new SQLLiteStorage(NewDataCallback));
     }
     else if (cfg is CSVConfig)
     {
         return(new CSVStorage(NewDataCallback));
     }
     else if (cfg is ExcelConfig)
     {
         return(new ExcelStorage(NewDataCallback));
     }
     else if (cfg is PostgreSQLConfig)
     {
         return(new PostgreSQLStorage(NewDataCallback));
     }
     else if (cfg is MySQLConfig)
     {
         return(new MySQLStorage(NewDataCallback));
     }
     else if (cfg is Excel2007Config)
     {
         return(new Excel2007Storage(NewDataCallback));
     }
     else if (cfg is MsSQLConfig)
     {
         return(new MsSQLStorage(NewDataCallback));
     }
     else if (cfg is PLCConfig)
     {
         return(new PLCStorage(NewDataCallback));
     }
     else if (cfg is MultiStorageConfig)
     {
         return(new MultiStorage.MultiStorage(config, cfg, NewDataCallback));
     }
     return(null);
 }
 public static IDBInterface GetStorage(ProtokollerConfiguration config, StorageConfig cfg, Action<string> NewDataCallback)
 {
     if (cfg is SQLiteConfig)
         return new SQLLiteStorage(NewDataCallback);
     else if (cfg is CSVConfig)
         return new CSVStorage(NewDataCallback);
     else if (cfg is ExcelConfig)
         return new ExcelStorage(NewDataCallback);
     else if (cfg is PostgreSQLConfig)
         return new PostgreSQLStorage(NewDataCallback);
     else if (cfg is MySQLConfig)
         return new MySQLStorage(NewDataCallback);
     else if (cfg is Excel2007Config)
         return new Excel2007Storage(NewDataCallback);
     else if (cfg is MsSQLConfig)
         return new MsSQLStorage(NewDataCallback);
     else if (cfg is PLCConfig)
         return new PLCStorage(NewDataCallback);
     else if (cfg is MultiStorageConfig)
         return new MultiStorage.MultiStorage(config, cfg, NewDataCallback);
     return null;
 }        
示例#11
0
 public ProtokollerInstance(ProtokollerConfiguration akConfig)
 {
     this.akConfig = akConfig;
 }
 public ProtokollerInstance(ProtokollerConfiguration akConfig)
 {
     this.akConfig = akConfig;
 }
 private void cmdImport_Click(object sender, RoutedEventArgs e)
 {
     ProtokollerConfiguration.ImportFromRegistry();
 }
 private void cmdClear_Click(object sender, RoutedEventArgs e)
 {
     ProtokollerConfiguration.Clear();
 }
 private void cmdReload_Click(object sender, RoutedEventArgs e)
 {
     ProtokollerConfiguration.Load();
 }
 private void cmdsave_Click(object sender, RoutedEventArgs e)
 {
     ProtokollerConfiguration.Save();
 }