Exemplo n.º 1
0
        public static bool Initialise()
        {
            mcData = new MCData();

            // Hook up debugging info
            mcData.DebugReport += new EventHandler <DebugReportEventArgs>(epg_DebugReport);
            mcData.RecordingsDataNeedsRefresh += new EventHandler(mcData_RecordingsDataNeedsRefresh);

            // Initialize MCData
            string key = "Wilkinson";

            isWMCOnline = mcData.Initialize(ref key);
            return(isWMCOnline);
        }
Exemplo n.º 2
0
        // Wrapper around mcdata
        public static bool ExternalPopulateTVChannels(bool skipCache)
        {
            if (AllTVChannels == null)
            {
                AllTVChannels = new Dictionary <string, TVService>();
            }
            if (!Settings.Default.EnableMediaCenterSupport)
            {
                return(true);
            }
            bool result;

            MCData tempMCData = null;

            try
            {
                tempMCData = new MCData();

                // Hook up debugging info
                tempMCData.DebugReport += new EventHandler <DebugReportEventArgs>(tempMCData_DebugReport);

                // Initialize MCData
                string key = "Wilkinson";
                isWMCOnline = tempMCData.Initialize(ref key);
                if (!isWMCOnline)
                {
                    return(false);
                }

                result = PopulateTVChannels(skipCache, tempMCData);
            }
            finally
            {
                if (tempMCData != null)
                {
                    tempMCData.DebugReport -= new EventHandler <DebugReportEventArgs>(tempMCData_DebugReport);

                    tempMCData.FreeResources();
                    tempMCData.Dispose();
                }
            }

            return(result);
        }