예제 #1
0
        /// <summary>
        /// Load application
        /// </summary>
        private static void LoadApp()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            //Run Lync registry modifcations
            Lync.CreateLyncMenu();

            //Run registry Watcher
            Lync.RegistryWatcher();

            //Get shared instance of LyncClientController - pass to other instances that require it
            LyncClientController lyncClientController = new LyncClientController();

            //Run Lync Presence Switcher
            LyncPresenceSwitcher lyncPresenceSwitcher = new LyncPresenceSwitcher();

            lyncPresenceSwitcher.lync = lyncClientController;

            settingsBox      = new SettingsBox();
            settingsBox.lync = lyncClientController;
            //settingsBox.ShowDialog();

 #if DEBUG
//new VideoPlayer().ShowDialog();
#endif

            //Video offer service
            var videoOfferService = new VideoOfferService();

            // Show the system tray icon.
            //using (ProcessIcon pi = new ProcessIcon())
            using (ProcessIcon pi = new ProcessIcon())
            {
                //Use to pass instance of ProcessIcon
                lyncPresenceSwitcher.processIcon = pi;
                videoOfferService.processIcon    = pi;

                //Pass Lync instance
                pi.lync = lyncClientController;

                pi.Display();

                // Make sure the application runs!
                Application.Run();
            }
        }
예제 #2
0
        // Handles the Click event of the settings control
        void Settings_Click(object sender, EventArgs e)
        {
            try
            {
                if (!isSettingsLoaded)
                {
                    isSettingsLoaded = true;
                    SettingsBox box = new SettingsBox();

                    //Pass Lync instance
                    box.lync = lync;

                    box.ShowDialog();
                    isSettingsLoaded = false;
                }
            }
            catch (Exception ex)
            {
                // AAAAAAAAAAARGH, an error!
                Shared.MB("Error on click event : " + ex.Message, "ERROR!");
            }
        }