private void _importButton_Click(object sender, EventArgs e) { CheckNeedToSaveChanges(); if (!SelectedPlugin.IsConfigured()) { MessageBox.Show("Please complete the plugin configuration of the selected plugin first.", "Incompletely configured plugin", MessageBoxButtons.OK); return; } SetFormMode(FormMode.Importing); DisableAllButtons(); try { _importProgressBar.Value = 0; _feedBackLabel.Text = String.Empty; _hoster.Import(SelectedPlugin.Name, ProgressUpdate, FeedbackUpdate); } catch (Exception ex) { ShowException(ex, "Import error"); } finally { Thread.Sleep(500); SetFormMode(FormMode.Normal); DoButtonEnabling(); } }
static void Main(string[] args) { Logger.SetLogFilePath("GuideImporter.log", Properties.Settings.Default.LogLevel); Logger.Write("Guide importer started."); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Dictionary<string, string> parsedArguments = ParseArguments(args); bool runsQuiet = NeedsToRunQuiet(parsedArguments); string initErrorMessage; InitializeArgusTVServiceChannelFactories(out initErrorMessage); if (Proxies.IsInitialized) { try { Hoster hoster = new Hoster(); if (runsQuiet) { string pluginToUse = GetSelectedPlugin(parsedArguments); if (String.IsNullOrEmpty(pluginToUse)) { Logger.Write(TraceEventType.Error, "Invalid number of arguments supplied!"); Hoster.LogMessageInArgusTV("Invalid number of arguments supplied!", LogSeverity.Information); } else { Logger.Write("Importing, using plugin:" + pluginToUse ); hoster.Import(pluginToUse); } } else { Application.Run(new MainForm(hoster)); } } catch (Exception e) { if (!String.IsNullOrEmpty(e.Message)) { Logger.Write("Exception during import: " + e.Message); if (e.InnerException != null && !String.IsNullOrEmpty(e.InnerException.Message)) Logger.Write("InnerException: " + e.InnerException.Message); } else { EventLogger.WriteEntry(e); } } } else { if (!runsQuiet) { MessageBox.Show("Could not connect to ARGUS TV:" + Environment.NewLine + Environment.NewLine + initErrorMessage + Environment.NewLine + Environment.NewLine + "Check your configuration!", "Guide Importer", MessageBoxButtons.OK); } else { Logger.Write(TraceEventType.Error, "Could not connect to ARGUS TV: {0} - check your configuration!", initErrorMessage); //EventLogger.WriteEntry("Could not initialize ARGUS TV serviceChannelFactories, check your configuration !", EventLogEntryType.Error); } } }
static void Main(string[] args) { Logger.SetLogFilePath("GuideImporter.log", Properties.Settings.Default.LogLevel); Logger.Write("Guide importer started."); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Dictionary <string, string> parsedArguments = ParseArguments(args); bool runsQuiet = NeedsToRunQuiet(parsedArguments); string initErrorMessage; InitializeArgusTVServiceChannelFactories(out initErrorMessage); if (ServiceChannelFactories.IsInitialized) { try { Hoster hoster = new Hoster(); if (runsQuiet) { string pluginToUse = GetSelectedPlugin(parsedArguments); if (String.IsNullOrEmpty(pluginToUse)) { Logger.Write(TraceEventType.Error, "Invalid number of arguments supplied!"); Hoster.LogMessageInArgusTV("Invalid number of arguments supplied!", LogSeverity.Information); } else { Logger.Write("Importing, using plugin:" + pluginToUse); hoster.Import(pluginToUse); } } else { Application.Run(new MainForm(hoster)); } } catch (Exception e) { if (!String.IsNullOrEmpty(e.Message)) { Logger.Write("Exception during import: " + e.Message); if (e.InnerException != null && !String.IsNullOrEmpty(e.InnerException.Message)) { Logger.Write("InnerException: " + e.InnerException.Message); } } else { EventLogger.WriteEntry(e); } } } else { if (!runsQuiet) { MessageBox.Show("Could not connect to ARGUS TV:" + Environment.NewLine + Environment.NewLine + initErrorMessage + Environment.NewLine + Environment.NewLine + "Check your configuration!", "Guide Importer", MessageBoxButtons.OK); } else { Logger.Write(TraceEventType.Error, "Could not connect to ARGUS TV: {0} - check your configuration!", initErrorMessage); //EventLogger.WriteEntry("Could not initialize ARGUS TV serviceChannelFactories, check your configuration !", EventLogEntryType.Error); } } }