Exemple #1
0
        private void LoadSettings()
        {
            //Reload Settings
            XBMCUsername    = Settings.Default.XBMCUser;
            XBMCPassword    = Settings.Default.XBMCPassword;
            XBMCHost        = Settings.Default.XBMCHost;
            XBMCEvent       = Settings.Default.XBMCEvent;
            XBMCPort        = Settings.Default.XBMCPort;
            RunningPort     = Settings.Default.PortToListenTo;
            ProgramToLaunch = Settings.Default.ProgramToLaunch;
            ExitIfOpen      = Settings.Default.ExitIfOpen;
            UseEvent        = Settings.Default.UseXBMCEvent;
            Autostart       = Settings.Default.Autostart;

            if (running)
            {
                Listener.StopListener();
                ListenerThread.Interrupt();
                ListenerThread.Join();
                running             = false;
                btStartStop.Enabled = false;
                lblStatus.Text      = "Restarting...";
                this.Update();

                Thread.Sleep(1000);

                Listener = new UDPListener(ProgramToLaunch, RunningPort, ExitIfOpen, UseEvent, XBMCUsername, XBMCPassword, XBMCHost, XBMCPort, XBMCEvent);
                StartListenerThread();
            }
        }
        public UDPLauncher_Main_Frm()
        {
            InitializeComponent();
            cMSTray_txtStatus.BackColor = Color.White;
            nIcon.Icon = Resources.picBulbOff;
            nIcon.BalloonTipText = "Listener not running.";
            nIcon.BalloonTipTitle = "UDPLauncher";
            nIcon.ContextMenuStrip = cMSTray;
            cMSTray_txtStatus.Text = "Not Running";
            cMSTray_Stop.Enabled = false;

            this.LoadSettings();
            running = false;
            Listener = new UDPListener(ProgramToLaunch, RunningPort, ExitIfOpen, UseEvent, XBMCUsername, XBMCPassword, XBMCHost, XBMCPort, XBMCEvent);

            if (Autostart)
                this.StartListenerThread();
        }
Exemple #3
0
        public UDPLauncher_Main_Frm()
        {
            InitializeComponent();
            cMSTray_txtStatus.BackColor = Color.White;
            nIcon.Icon             = Resources.picBulbOff;
            nIcon.BalloonTipText   = "Listener not running.";
            nIcon.BalloonTipTitle  = "UDPLauncher";
            nIcon.ContextMenuStrip = cMSTray;
            cMSTray_txtStatus.Text = "Not Running";
            cMSTray_Stop.Enabled   = false;

            this.LoadSettings();
            running  = false;
            Listener = new UDPListener(ProgramToLaunch, RunningPort, ExitIfOpen, UseEvent, XBMCUsername, XBMCPassword, XBMCHost, XBMCPort, XBMCEvent);

            if (Autostart)
            {
                this.StartListenerThread();
            }
        }
        private void LoadSettings()
        {
            //Reload Settings
            XBMCUsername = Settings.Default.XBMCUser;
            XBMCPassword = Settings.Default.XBMCPassword;
            XBMCHost = Settings.Default.XBMCHost;
            XBMCEvent = Settings.Default.XBMCEvent;
            XBMCPort = Settings.Default.XBMCPort;
            RunningPort = Settings.Default.PortToListenTo;
            ProgramToLaunch = Settings.Default.ProgramToLaunch;
            ExitIfOpen = Settings.Default.ExitIfOpen;
            UseEvent = Settings.Default.UseXBMCEvent;
            Autostart = Settings.Default.Autostart;

            if (running)
            {
                Listener.StopListener();
                ListenerThread.Interrupt();
                ListenerThread.Join();
                running = false;
                btStartStop.Enabled = false;
                lblStatus.Text = "Restarting...";
                this.Update();

                Thread.Sleep(1000);

                Listener = new UDPListener(ProgramToLaunch, RunningPort, ExitIfOpen, UseEvent, XBMCUsername, XBMCPassword, XBMCHost, XBMCPort, XBMCEvent);
                StartListenerThread();
            }
        }