protected override async void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e) { if (e.NavigationMode == NavigationMode.New) { if (!App.AppEnabled) { MessageBox.Show("Your trial period has expired. You cannot use the app until you buy the full version."); App.Current.Terminate(); } //InitializerProcess.SendStatisctics(); if (!App.DatabaseExists() || AppFields.ForceUpdate) { var downloadResult = await DownloadDBDialog.Show(); DownloadDone(downloadResult); } if (InitializerProcess.FirstRun) { await ShowLocationConsentBox(); } FavoritesTab.SetContent(); contentSetterTask = new PeriodicTask(updateContent); contentSetterTask.RunEveryMinute(); string tile; if (NavigationContext.QueryString.TryGetValue("tile", out tile) && !tile.StartsWith("stoproute")) { IRouteStopPair pair = App.UB.TileRegister.Get(Int32.Parse(tile)); if (pair != null) { NavigateToRouteStopPage(this, pair.Route, pair.Stop); } } var checkUpdateResult = await UpdateMonitor.CheckUpdate(); if (checkUpdateResult == UpdateMonitor.Result.Found) { IndicateUpdateAvailable(); } } else { FavoritesTab.SetContent(); if (contentSetterTask != null) { contentSetterTask.Resume(); } } }
private async void updateContent() { FavoritesTab.UpdateContent(); if (SettingsModel.AutomaticNearSearch) { var nearestStop = await StopTransfers.GetNearestStop(await CurrentLocation.Get()); if (nearestStop != null) { FavoritesTab.NearStop = nearestStop.Stop.Group; PlanningTab.SetNearStop(nearestStop.Stop.Group, nearestStop.EstimatedDuration); } } }
private void OnGUI() { if (textStyle == null) { Initialize(); } EditorGUILayout.BeginVertical(); GUILayout.Box("Favorites Tab[s]", bigTextStyle); GUILayout.Label("Version " + FavoritesTab.GetVersionString(), textStyle); GUILayout.FlexibleSpace(); GUILayout.BeginHorizontal(); GUILayout.Space(20f); if (GUILayout.Button(flipbookLogo, GUIStyle.none)) { Application.OpenURL("http://flipbookgames.com/"); } if (Event.current.type == EventType.Repaint) { EditorGUIUtility.AddCursorRect(GUILayoutUtility.GetLastRect(), MouseCursor.Link); } GUILayout.FlexibleSpace(); GUILayout.BeginVertical(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Close")) { Close(); } GUILayout.EndVertical(); GUILayout.Space(16f); GUILayout.EndHorizontal(); GUILayout.Space(4f); GUILayout.Label("\xa9 Flipbook Games. All Rights Reserved.", miniTextStyle); EditorGUILayout.EndVertical(); }
void ReleaseDesignerOutlets() { if (AfflictionsTab != null) { AfflictionsTab.Dispose(); AfflictionsTab = null; } if (ApplyButton != null) { ApplyButton.Dispose(); ApplyButton = null; } if (BottomView != null) { BottomView.Dispose(); BottomView = null; } if (CloseButton != null) { CloseButton.Dispose(); CloseButton = null; } if (ConditionDetailWebView != null) { ConditionDetailWebView.Dispose(); ConditionDetailWebView = null; } if (ConditionsTab != null) { ConditionsTab.Dispose(); ConditionsTab = null; } if (CustomTab != null) { CustomTab.Dispose(); CustomTab = null; } if (DurationLabel != null) { DurationLabel.Dispose(); DurationLabel = null; } if (FavoritesTab != null) { FavoritesTab.Dispose(); FavoritesTab = null; } if (FilterText != null) { FilterText.Dispose(); FilterText = null; } if (SelectionTable != null) { SelectionTable.Dispose(); SelectionTable = null; } if (SpellsTab != null) { SpellsTab.Dispose(); SpellsTab = null; } if (TitleView != null) { TitleView.Dispose(); TitleView = null; } if (TopView != null) { TopView.Dispose(); TopView = null; } }