public App(IPlatformRegistrar platformRegistrar) { InitializeComponent(); var composition = new CompositionRoot(platformRegistrar); composition.StartPage <MainViewModel>(); MainPage = new NavigationRoot(); }
private IEnumerator Move(NavigationRoot navigationPointData) { //Disable movement PlayerData.cameraController.active = false; MouseController.showMouse = false; //Fade out fader.FadeOut(); while (fader.Fading) { yield return(null); } if (currentNavigationPoint != null) { if (currentNavigationPoint.onExit != null) { currentNavigationPoint.onExit.Invoke(); } } //Set player position to root position of navigation trigger PlayerData.transform.position = navigationPointData.transform.position; PlayerData.transform.rotation = navigationPointData.transform.rotation; if (playerMoved != null) { playerMoved.Invoke(); } //Fade in fader.FadeIn(); while (fader.Fading) { yield return(null); } navigating = false; lastNavigationPoint.Add(currentNavigationPoint); currentNavigationPoint = navigationPointData; if (currentNavigationPoint.onArrival != null) { currentNavigationPoint.onArrival.Invoke(); } //Enable movement PlayerData.cameraController.active = true; MouseController.showMouse = true; }
private void InitWindow(bool skipWindowCreation) { var builder = new ContainerBuilder(); rootPage = Window.Current.Content as NavigationRoot; bool initApp = rootPage == null && !skipWindowCreation; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (initApp) { // Create a Frame to act as the navigation context and navigate to the first page rootPage = new NavigationRoot(); FrameAdapter adapter = new FrameAdapter(rootPage.AppFrame); builder.RegisterInstance(adapter) .AsImplementedInterfaces(); builder.RegisterType <HomeViewModel>(); // The feed details view model needs to be a singleton in order to better accomodate Connected Animation builder.RegisterType <FeedDetailsViewModel>() .SingleInstance(); builder.RegisterType <EpisodeDetailsViewModel>(); builder.RegisterType <PlayerViewModel>(); builder.RegisterType <InkNoteViewModel>(); builder.RegisterType <FavoritesViewModel>(); builder.RegisterType <NotesViewModel>(); builder.RegisterType <DownloadsViewModel>(); builder.RegisterType <SettingsViewModel>(); builder.RegisterType <NavigationService>() .AsImplementedInterfaces() .SingleInstance(); builder.RegisterType <RemotePlayService>() .AsImplementedInterfaces(); builder.RegisterInstance(PlayerService.Current) .AsImplementedInterfaces() .SingleInstance(); _container = builder.Build(); rootPage.InitializeNavigationService(_container.Resolve <INavigationService>()); adapter.NavigationFailed += OnNavigationFailed; // Place the frame in the current Window Window.Current.Content = rootPage; Window.Current.Activate(); } }
public void UpdateNavigation(NavigationRoot navigation, string username, string password) { if (SiteSecurity.Login(username, password).Role != "admin") { throw new Exception("Invalid Password"); } string fullPath = HttpContext.Current.Server.MapPath("SiteConfig/navigation.xml"); XmlSerializer ser = new XmlSerializer(typeof(NavigationRoot)); using (StreamWriter writer = new StreamWriter(fullPath)) { ser.Serialize(writer, navigation); } }
private void LoadList(string fileName) { if (File.Exists(fileName)) { using (Stream s = File.OpenRead(fileName)) { XmlSerializer ser = new XmlSerializer(typeof(NavigationRoot)); navigationRoot = (NavigationRoot)ser.Deserialize(s); } } else { navigationRoot = new NavigationRoot(); } Session["newtelligence.DasBlog.Web.EditNavigatorLinksBox.NavigationRoot"] = navigationRoot; }
private void LoadList( string fileName ) { if (File.Exists(fileName)) { using (Stream s = File.OpenRead(fileName)) { XmlSerializer ser = new XmlSerializer(typeof(NavigationRoot)); navigationRoot = (NavigationRoot)ser.Deserialize(s); } } else { navigationRoot = new NavigationRoot(); } Session["newtelligence.DasBlog.Web.EditNavigatorLinksBox.NavigationRoot"] = navigationRoot; }
private void InitWindow(bool skipWindowCreation) { var builder = new ContainerBuilder(); _rootPage = Window.Current.Content as NavigationRoot; bool initApp = _rootPage == null && !skipWindowCreation; // Do not repeat app initialization when the Window already has content, // just ensure that the window is active if (initApp) { // Create a Frame to act as the navigation context and navigate to the first page _rootPage = new NavigationRoot(); FrameAdapter adapter = new FrameAdapter(_rootPage.AppFrame); builder.RegisterInstance(adapter) .AsImplementedInterfaces(); // Register the view models to the builder builder.RegisterType <CompaniesViewModel>(); builder.RegisterType <CompanyDetailsViewModel>().SingleInstance(); builder.RegisterType <EditCompanyDetailsViewModel>(); builder.RegisterType <AddCompanyViewModel>().SingleInstance(); builder.RegisterType <AccountViewModel>(); builder.RegisterType <SettingsViewModel>(); builder.RegisterType <OwnerAccountViewModel>(); builder.RegisterType <NavigationService>() .AsImplementedInterfaces() .SingleInstance(); _container = builder.Build(); _rootPage.InitializeNavigationService(_container.Resolve <INavigationService>()); _rootPage.NavigateToStartPage(); adapter.NavigationFailed += OnNavigationFailed; // Place the frame in the current Window Window.Current.Content = _rootPage; Window.Current.Activate(); } }
protected void Page_Load(object sender, System.EventArgs e) { if (SiteSecurity.IsInRole("admin") == false) { Response.Redirect("~/FormatPage.aspx?path=SiteConfig/accessdenied.format.html"); } resmgr = ((System.Resources.ResourceManager)ApplicationResourceTable.Get()); if (!IsPostBack || Session["newtelligence.DasBlog.Web.EditNavigatorLinksBox.NavigationRoot"] == null) { SharedBasePage requestPage = Page as SharedBasePage; string fileName = Path.Combine(SiteConfig.GetConfigPathFromCurrentContext(), baseFileName); LoadList(fileName); } else { navigationRoot = Session["newtelligence.DasBlog.Web.EditNavigatorLinksBox.NavigationRoot"] as NavigationRoot; } BindGrid(); }
protected void Page_Load(object sender, System.EventArgs e) { if (SiteSecurity.IsInRole("admin") == false) { Response.Redirect("~/FormatPage.aspx?path=SiteConfig/accessdenied.format.html"); } resmgr = ((System.Resources.ResourceManager)ApplicationResourceTable.Get()); if ( !IsPostBack || Session["newtelligence.DasBlog.Web.EditNavigatorLinksBox.NavigationRoot"] == null ) { SharedBasePage requestPage = Page as SharedBasePage; string fileName = Path.Combine(SiteConfig.GetConfigPathFromCurrentContext(),baseFileName); LoadList( fileName ); } else { navigationRoot = Session["newtelligence.DasBlog.Web.EditNavigatorLinksBox.NavigationRoot"] as NavigationRoot; } BindGrid(); }
private void Start() { fader = gameObject.GetComponent <Fader>(); GameObject gameObject1 = GameObject.FindGameObjectWithTag("FirstNavPoint"); PlayerData.transform.position = gameObject1.transform.parent.GetChild(0).position; PlayerData.transform.rotation = gameObject1.transform.parent.GetChild(0).rotation; if (playerMoved != null) { playerMoved.Invoke(); } NavigationRoot navigationPointData = gameObject1.transform.parent.GetComponentInChildren <NavigationRoot>(); currentNavigationPoint = navigationPointData; if (currentNavigationPoint.onArrival != null) { currentNavigationPoint.onArrival.Invoke(); } }
public NavigationRoot ReadNavigation(string username, string password) { if (SiteSecurity.Login(username, password).Role != "admin") { throw new Exception("Invalid Password"); } string fullPath = HttpContext.Current.Server.MapPath("SiteConfig/navigation.xml"); if (File.Exists(fullPath)) { XmlSerializer ser = new XmlSerializer(typeof(NavigationRoot)); using (StreamReader reader = new StreamReader(fullPath)) { NavigationRoot nav = (NavigationRoot)ser.Deserialize(reader); return(nav); } } else { return(new NavigationRoot()); } }
private async void InitWindow(SplashScreen splash, bool skipWindowCreation = false) { _rootPage = Window.Current.Content as NavigationRoot; var shouldInit = _rootPage == null && !skipWindowCreation; if (shouldInit) { var extSplash = new ExtendedSplash(splash); Window.Current.Content = extSplash; Window.Current.Activate(); _rootPage = new NavigationRoot(); var adapter = new FrameAdapter(_rootPage.AppFrame); adapter.NavigationFailed += OnNavigationFailed; var builder = new ContainerBuilder(); builder.RegisterInstance(adapter).AsImplementedInterfaces(); builder.RegisterType <DashboardViewModel>(); builder.RegisterType <DesktopViewModel>(); builder.RegisterType <NavigationService>().AsImplementedInterfaces().SingleInstance(); _container = builder.Build(); var navService = _container.Resolve <INavigationService>(); navService.RegisterPageViewModel <Dashboard, DashboardViewModel>(); navService.RegisterPageViewModel <Desktop, DesktopViewModel>(); _rootPage.InitializeNavigationService(navService); await navService.NavigateToDashboard(new FrameNavigationOptions()); await extSplash.RunAsync().ConfigureAwait(true); Window.Current.Content = _rootPage; Window.Current.Activate(); } }