public void Launch(AddInHost host) { session = new HistoryOrientedPageSession(); Application app = new Application(session, host); app.Start(); }
public BuddyViewer(HistoryOrientedPageSession session, AddInHost host) { this.session = session; this.host = host; _status = RunningStatus.Stopped; _jobslist = new ArrayListDataSet(this); MCEBuddyConf.GlobalMCEConfig = new MCEBuddyConf(); // Initialize with default parameters for now, we will get the config file from the server and then re-initialize (don't use null as it keeps accessing win.ini) - this is never written to a file (just a memory object) }
public void Launch(AddInHost host) { if (host != null && host.ApplicationContext != null) { host.ApplicationContext.SingleInstance = true; } s_session = new HistoryOrientedPageSession(); s_session.GoToPage("resx://$projectname$/$safeprojectname$.Resources/Default"); }
public void Launch(AddInHost host) { if (host != null && host.ApplicationContext != null) { host.ApplicationContext.SingleInstance = true; } s_session = new HistoryOrientedPageSession(); s_session.GoToPage("resx://CellarTrackerAddIn2/CellarTrackerAddIn2.Resources.Default"); }
public void Launch(AddInHost host) { if (host != null && host.ApplicationContext != null) { host.ApplicationContext.SingleInstance = true; } s_session = new HistoryOrientedPageSession(); Application app = new Application(s_session, host); app.GoToMenu(); }
public void Launch(AddInHost host) { if (host != null && host.ApplicationContext != null) { host.ApplicationContext.SingleInstance = true; } s_session = new HistoryOrientedPageSession(); Application app = new Application(s_session, host); string sectionGuid = host.ApplicationContext.EntryPointInfo["context"].ToString(); app.GoToSection(sectionGuid); }
public void Launch(AddInHost host) { if (host != null && host.ApplicationContext != null) { host.ApplicationContext.SingleInstance = true; } //host.MediaCenterEnvironment.PlayMedia(Microsoft.MediaCenter.MediaType.Datacast, s_session = new HistoryOrientedPageSession(); s_session.GoToPage("resx://CellarTrackerAddIn/CellarTrackerAddIn.Resources/Default"); XMLData Data = new XMLData(); Data.Test(); }
public Application(HistoryOrientedPageSession session, AddInHost host) { this.session = session; this.host = host; _myData = new ArrayListDataSet(); var list = GetFeedList(); foreach (var radio in list) { _myData.Add(radio); } }
public void Launch(AddInHost host) { if (host != null && host.ApplicationContext != null) { host.ApplicationContext.SingleInstance = true; } s_session = new HistoryOrientedPageSession(); s_session.GoToPage("resx://CellarTrackerProject/CellarTrackerProject.Resources/CellarMain"); //CellarTrackerProject.Properties.Settings.Default.Username = "******"; //CellarTrackerProject.Properties.Settings.Default.Password = "******"; //CellarTrackerProject.Properties.Settings.Default.Save(); }
/// <summary> /// Launches the add-on. /// </summary> /// <param name="host">Represents the media center host.</param public void Launch(AddInHost host) { if (host != null && host.ApplicationContext != null) { host.ApplicationContext.SingleInstance = true; AddInHost = host; } #if DEBUG AddInHost.MediaCenterEnvironment.Dialog("Attach debugger and hit ok", "myForecast - Debug", DialogButtons.Ok, 100, true); #endif Session = new HistoryOrientedPageSession(); GoMainPage(); }
// // Launch (IAddInModule) // public void Launch(AddInHost host) { if (host != null && host.ApplicationContext != null) { host.ApplicationContext.SingleInstance = true; } s_session = new HistoryOrientedPageSession(); Application app = new Application(s_session, host); // Set the background color // Matches Background.C from Syles.mcml host.MediaCenterEnvironment.BackgroundColor = System.Drawing.Color.FromArgb(21, 35, 39); // Navigate to the main menu. app.GoToStartPage(); }
/// <summary> /// Construct an Application object and associate it with a page /// session. /// </summary> public Application(HistoryOrientedPageSession session, AddInHost host) { // Store the page session and host this.session = session; this.host = host; // initialize the field used by the static Application.Current property singleApplicationInstance = this; // // Construct the application experiences // AddExperience(new Movies()); AddExperience(new TV()); AddExperience(new Music()); }
public void Launch(AddInHost host) { try { if (this.executionInfo.Media != null && this.executionInfo.Media.Count > 0) { bool flag = true; foreach (MediaInfo mediaInfo in this.executionInfo.Media) { MediaCenterEnvironment centerEnvironment = AddInHost.Current.MediaCenterEnvironment; MediaType?mediaType = mediaInfo.MediaType; int num1 = mediaType.HasValue ? (int)mediaType.GetValueOrDefault() : -1; string url = mediaInfo.Url; int num2 = !flag ? 1 : 0; centerEnvironment.PlayMedia((MediaType)num1, (object)url, num2 != 0); flag = false; } MediaExperience mediaExperience = AddInHost.Current.MediaCenterEnvironment.MediaExperience; if (mediaExperience != null) { mediaExperience.GoToFullScreen(); } } if (VmcExecuteAddIn.ExecutionEngine != null) { VmcExecuteAddIn.session = new HistoryOrientedPageSession(); ((PageSession)VmcExecuteAddIn.session).GoToPage("resx://Advent.VmcExecute/Advent.VmcExecute.Resources/MainPage"); VmcExecuteAddIn.ExecutionEngine.BeginExecute(); } else { if (!this.executionInfo.Page.HasValue) { return; } AddInHost.Current.MediaCenterEnvironment.NavigateToPage(this.executionInfo.Page.Value, (object)null); } } catch (Exception ex) { VmcExecuteAddIn.LogError(ex.ToString()); throw; } }
public void Launch(AddInHost host) { if (host != null && host.ApplicationContext != null) { host.ApplicationContext.SingleInstance = true; } s_session = new HistoryOrientedPageSession(); Application app = new Application(s_session, host); string appdata = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); string[] fileList = Directory.GetFiles(appdata + @"\Microsoft\Windows\Temporary Internet Files", "watch_as3*.swf", SearchOption.AllDirectories); foreach (string f in fileList) { File.Delete(f); } //app.GoToMenu(); host.MediaCenterEnvironment.NavigateToPage(PageId.ExtensibilityUrl, "http://www.youtube.com/leanback"); host.MediaCenterEnvironment.MediaExperience.Transport.PlayRate = 0; }
public Application(HistoryOrientedPageSession session, AddInHost host) { this.session = session; this.host = host; singleApplicationInstance = this; }
private void StartPlaylist() { Debug.WriteLine("StartPlaylist"); int rowid = 0; string contentpath; string slideshowpath; string visualizationpath; Debug.WriteLine("Evaluating EntrypointID"); switch (id) { // Even though the registration GUIDs have ALL CAPS // they are written to the registry with lower case. // These should match exactly what is shown in the // registry instead of the registration file. case "{30f10141-61f8-45b1-b369-1b508d080bd7}": session = new HistoryOrientedPageSession(); session.GoToPage("resx://PowerPlaylist/PowerPlaylist.Resources/Default"); break; case "{dfd75e76-7530-4d0d-a126-71863200a556}": rowid = 1; break; case "{b9b49dbf-fb85-4a80-beb7-5732c4ba849e}": rowid = 2; break; case "{4a03b055-eea0-466f-b4fd-ae72d41fdb02}": rowid = 3; break; case "{f8216194-c5c8-4fc8-98b8-b33ef15b36aa}": rowid = 4; break; case "{9580a0b8-f06f-4422-94d2-4aae0a26b3b3}": rowid = 5; break; } if (rowid <= 5 && rowid >= 1) { Debug.WriteLine("Getting data from dataset."); try { DataRow dataRow = GetSingleDataRow(dataSet.Tables["Table"], "ID=" + rowid.ToString()); contentpath = (null == dataRow[(int)DataColumnPath.ContentPath]) ? null : dataRow[(int)DataColumnPath.ContentPath].ToString(); slideshowpath = (null == dataRow[(int)DataColumnPath.SlideshowPath]) ? null : dataRow[(int)DataColumnPath.SlideshowPath].ToString(); visualizationpath = (null == dataRow[(int)DataColumnPath.VisualizationPath]) ? null : dataRow[(int)DataColumnPath.VisualizationPath].ToString(); } catch (System.Exception e) { MessageBox("PowerPlaylist had a problem reading the data file and can't continue. Exception: " + e.Message.ToString()); return; } if (!string.IsNullOrEmpty(contentpath)) { Debug.WriteLine(contentpath); PlayContent(contentpath); } if (string.IsNullOrEmpty(visualizationpath) && string.IsNullOrEmpty(slideshowpath)) { // The user has specified only audio content. // Thus we will navgate to the full screen experience. GoFullscreen(); return; } // If the user specifies both visualization and // slideshow paths the slideshow will win. if (!string.IsNullOrEmpty(slideshowpath)) { Debug.WriteLine(slideshowpath); StartSlideshow(slideshowpath); } else { if (!string.IsNullOrEmpty(visualizationpath)) { Debug.WriteLine(visualizationpath); StartVisualization(visualizationpath); } } } }
public Application(HistoryOrientedPageSession session, AddInHost host) { this.session = session; this.host = host; }
public OMLApplication(HistoryOrientedPageSession session, AddInHost host) { #if LAYOUT_V3 //sets up the hooks for context menu this.hooker = new Library.Code.V3.MoreInfoHooker2(); this.mouseActiveHooker = new Library.Code.V3.IsMouseActiveHooker(); this.mouseActiveHooker.MouseActive += new Library.Code.V3.IsMouseActiveHooker.MouseActiveHandler(mouseActiveHooker_MouseActive); #endif this.parentalControlManager = new ParentalControlManager(); this._session = session; AddInHost.Current.MediaCenterEnvironment.PropertyChanged +=new PropertyChangedEventHandler(MediaCenterEnvironment_PropertyChanged); //I know its a factory //this._factory = new MoviePlayerFactory(); try { // borrowed from vmcNetFlix project on google-code bool isConsole = false; if (host.MediaCenterEnvironment.Capabilities.ContainsKey("Console")) { isConsole = (bool)host.MediaCenterEnvironment.Capabilities["Console"]; } bool isVideo = false; if (host.MediaCenterEnvironment.Capabilities.ContainsKey("Video")) { isVideo = (bool)host.MediaCenterEnvironment.Capabilities["Video"]; } if (isConsole == false) { if (isVideo == true) _isExtender = true; } } catch (Exception) { _isExtender = false; } #if DEBUG_EXT System.Diagnostics.Debugger.Launch(); _isExtender = true; #endif #if DEBUG OMLApplication.DebugLine("[OMLApplication] MediaCenterEnvironment.Capabilities:"); foreach (KeyValuePair<string, object> cap in host.MediaCenterEnvironment.Capabilities) try { DebugLine(" ['{0}'] = '{1}'", cap.Key, cap.Value); } catch { } #else OMLApplication.DebugLine("[OMLApplication] constructor called"); #endif this._host = host; _singleApplicationInstance = this; I18n.InitializeResourceManager(); string uiCulture = OMLSettings.UILanguage; if (!string.IsNullOrEmpty(uiCulture)) I18n.SetCulture(new CultureInfo(uiCulture)); _nowPlayingMovieName = "Playing an unknown movie"; }
public void Launch(AddInHost host) { s_session = new HistoryOrientedPageSession(); s_session.GoToPage("resx://MCRadio/MCRadio.Resources/Default"); }
public void Launch(AddInHost host) { try { if (this.executionInfo.Media != null && this.executionInfo.Media.Count > 0) { bool flag = true; foreach (MediaInfo mediaInfo in this.executionInfo.Media) { MediaCenterEnvironment centerEnvironment = AddInHost.Current.MediaCenterEnvironment; MediaType? mediaType = mediaInfo.MediaType; int num1 = mediaType.HasValue ? (int)mediaType.GetValueOrDefault() : -1; string url = mediaInfo.Url; int num2 = !flag ? 1 : 0; centerEnvironment.PlayMedia((MediaType)num1, (object)url, num2 != 0); flag = false; } MediaExperience mediaExperience = AddInHost.Current.MediaCenterEnvironment.MediaExperience; if (mediaExperience != null) mediaExperience.GoToFullScreen(); } if (VmcExecuteAddIn.ExecutionEngine != null) { VmcExecuteAddIn.session = new HistoryOrientedPageSession(); ((PageSession)VmcExecuteAddIn.session).GoToPage("resx://Advent.VmcExecute/Advent.VmcExecute.Resources/MainPage"); VmcExecuteAddIn.ExecutionEngine.BeginExecute(); } else { if (!this.executionInfo.Page.HasValue) return; AddInHost.Current.MediaCenterEnvironment.NavigateToPage(this.executionInfo.Page.Value, (object)null); } } catch (Exception ex) { VmcExecuteAddIn.LogError(ex.ToString()); throw; } }
public OMLApplication(HistoryOrientedPageSession session, AddInHost host) { #if LAYOUT_V3 //sets up the hooks for context menu this.hooker = new Library.Code.V3.MoreInfoHooker2(); this.mouseActiveHooker = new Library.Code.V3.IsMouseActiveHooker(); this.mouseActiveHooker.MouseActive += new Library.Code.V3.IsMouseActiveHooker.MouseActiveHandler(mouseActiveHooker_MouseActive); #endif this.parentalControlManager = new ParentalControlManager(); this._session = session; AddInHost.Current.MediaCenterEnvironment.PropertyChanged += new PropertyChangedEventHandler(MediaCenterEnvironment_PropertyChanged); //I know its a factory //this._factory = new MoviePlayerFactory(); try { // borrowed from vmcNetFlix project on google-code bool isConsole = false; if (host.MediaCenterEnvironment.Capabilities.ContainsKey("Console")) { isConsole = (bool)host.MediaCenterEnvironment.Capabilities["Console"]; } bool isVideo = false; if (host.MediaCenterEnvironment.Capabilities.ContainsKey("Video")) { isVideo = (bool)host.MediaCenterEnvironment.Capabilities["Video"]; } if (isConsole == false) { if (isVideo == true) { _isExtender = true; } } } catch (Exception) { _isExtender = false; } #if DEBUG_EXT System.Diagnostics.Debugger.Launch(); _isExtender = true; #endif #if DEBUG OMLApplication.DebugLine("[OMLApplication] MediaCenterEnvironment.Capabilities:"); foreach (KeyValuePair <string, object> cap in host.MediaCenterEnvironment.Capabilities) { try { DebugLine(" ['{0}'] = '{1}'", cap.Key, cap.Value); } catch { } } #else OMLApplication.DebugLine("[OMLApplication] constructor called"); #endif this._host = host; _singleApplicationInstance = this; I18n.InitializeResourceManager(); string uiCulture = OMLSettings.UILanguage; if (!string.IsNullOrEmpty(uiCulture)) { I18n.SetCulture(new CultureInfo(uiCulture)); } _nowPlayingMovieName = "Playing an unknown movie"; }
public void Launch(AddInHost host) { Host = host; _session = new HistoryOrientedPageSession(); GoToPlayback(@"http://cloudstash.com/gamechanger.mpg"); }
public void Launch(AddInHost host) { WriteDebugMessage("Launch"); this.host = host; if (host != null && host.ApplicationContext != null) { WriteDebugMessage("Set SingleInstance = True"); host.ApplicationContext.SingleInstance = true; } // List out the capabilities to the debug window. Dictionary <string, object> capabilities = host.MediaCenterEnvironment.Capabilities; try { foreach (KeyValuePair <string, object> kvp in capabilities) { WriteDebugMessage(String.Format("{0}{1} = {2}", "Capability: ", kvp.Key, kvp.Value)); } } catch (Exception ex) { WriteExceptionDebugMessage(ex); } session = new HistoryOrientedPageSession(); Categories = new ArrayListDataSet(); Samples = new ArrayListDataSet(); publicDocumentsPath = GetPath(KnownFolder.PublicDocuments); SetInstallationFolder(); SetPaths(); SetLocalContent(); SetDataFile(); LoadDataAndCategories(); Dictionary <string, object> props = new Dictionary <string, object>(); props.Add("Session", session); props.Add("Categories", Categories); props.Add("Sampler", this); automationfile = publicDocumentsPath + @"\" + samplerAutomationFile; KeepCurrentOnBackstack = true; // Look to see if we have a file which tells us to load a specific example. // If so, go there. switch (id) { case "{7f1e2adf-5006-44fb-8f3d-095e635ab443}": // Launched from Extras Library (More Programs) WriteDebugMessage("Launched from Extras Library"); if (NavigateFromAutomationFile()) { break; } // Else failed to navigate to sample, so fall through for default navigate // Go to the default page for the application. session.GoToPage("resx://Sampler/Sampler.Resources/Default", props); WriteDebugMessage("GoToDefaultPage"); break; case "{7b42c522-ac1e-4eff-b60b-0e01208551cc}": WriteDebugMessage("Launched from More With This.Audio.Album"); LaunchMoreWithThis(props, "resx://Sampler/Sampler.Resources/ObjectModelMediaCenterAddInHostMediaContextAlbum"); break; case "{5f51f6cd-7bd9-48d2-a016-c8dd7b1e82c3}": WriteDebugMessage("Launched from More With This.Audio.Artist"); LaunchMoreWithThis(props, "resx://Sampler/Sampler.Resources/ObjectModelMediaCenterAddInHostMediaContextArtist"); break; case "{084c6878-b10b-4453-a707-8025fc2cad77}": WriteDebugMessage("Launched from More With This.Audio.Genre"); LaunchMoreWithThis(props, "resx://Sampler/Sampler.Resources/ObjectModelMediaCenterAddInHostMediaContextGenre"); break; case "{e90d1b82-2d5d-4916-8022-52b5c994aa1b}": WriteDebugMessage("Launched from More With This.Audio.Playlist"); LaunchMoreWithThis(props, "resx://Sampler/Sampler.Resources/ObjectModelMediaCenterAddInHostMediaContextPlaylist"); break; case "{f06c05c0-7f5a-471a-8560-a35fa243b72e}": WriteDebugMessage("Launched from More With This.Audio.Song"); LaunchMoreWithThis(props, "resx://Sampler/Sampler.Resources/ObjectModelMediaCenterAddInHostMediaContextSong"); break; case "{37cc3cf8-c2b9-4da0-aa95-2aac0f37d393}": WriteDebugMessage("Launched from More With This.Picture"); LaunchMoreWithThis(props, "resx://Sampler/Sampler.Resources/ObjectModelMediaCenterAddInHostMediaContextPicture"); break; case "{9608152f-4996-4928-9a34-8115d893971e}": WriteDebugMessage("Launched from More With This.Video"); LaunchMoreWithThis(props, "resx://Sampler/Sampler.Resources/ObjectModelMediaCenterAddInHostMediaContextVideo"); break; case "{fb69d092-51c7-4a6d-8f87-5b12d1d88c42}": WriteDebugMessage("Launched from More With This.DVD"); LaunchMoreWithThis(props, "resx://Sampler/Sampler.Resources/ObjectModelMediaCenterAddInHostMediaContextDVD"); break; case "{33c6fd2f-a538-4604-8242-ce57e6724427}": WriteDebugMessage("Launched from More With This.TV"); LaunchMoreWithThis(props, "resx://Sampler/Sampler.Resources/ObjectModelMediaCenterAddInHostMediaContextTV"); break; } SetupWatcher(); WriteDebugMessage("Launch Complete"); }