Ejemplo n.º 1
0
        /// <summary>
        /// After the plugin has been created Media Center 
        /// will call the following method, giving us a reference
        /// to the Media Center interface.
        /// </summary>
        /// <param name="mediaCenterReference">
        /// Media Center Reference
        /// </param>        
        public void Init(MediaJukebox.MediaJukeboxAutomation mcr)
        {
            // Dunno why sometimes plugin is loaded twice. If that's the case, we simply ignore the second load
            if (Lglcd.Initialized)
                return;

            try
            {
                mediaCenterReference = mcr;
                AMJ = new AppletMediaJukebox(mediaCenterReference, this);
                mcr.FireMJEvent += new MediaJukebox.IMJAutomationEvents_FireMJEventEventHandler(MediaJukeboxHandler);
                Disposed += new EventHandler(MainInterface_Disposed);
            }
            catch (Exception e)
            {
                ExceptionHandler(e);
            }
            //Placing anything outside of this
            //try catch may cause MC to fail to open.
            //Play safe and insert it try area!
        }
Ejemplo n.º 2
0
        /// <summary>
        /// After the plugin has been created Media Center
        /// will call the following method, giving us a reference
        /// to the Media Center interface.
        /// </summary>
        /// <param name="mediaCenterReference">
        /// Media Center Reference
        /// </param>
        public void Init(MediaJukebox.MediaJukeboxAutomation mcr)
        {
            // Dunno why sometimes plugin is loaded twice. If that's the case, we simply ignore the second load
            if (Lglcd.Initialized)
            {
                return;
            }

            try
            {
                mediaCenterReference = mcr;
                AMJ              = new AppletMediaJukebox(mediaCenterReference, this);
                mcr.FireMJEvent += new MediaJukebox.IMJAutomationEvents_FireMJEventEventHandler(MediaJukeboxHandler);
                Disposed        += new EventHandler(MainInterface_Disposed);
            }
            catch (Exception e)
            {
                ExceptionHandler(e);
            }
            //Placing anything outside of this
            //try catch may cause MC to fail to open.
            //Play safe and insert it try area!
        }