예제 #1
0
 public MainForm(Hoster hoster)
 {
     _hoster = hoster;
     InitializeComponent();
 }
예제 #2
0
        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);
                }
            }
        }
예제 #3
0
        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);
                }
            }
        }
예제 #4
0
 public MainForm(Hoster hoster)
 {
     _hoster = hoster;
     InitializeComponent();
 }