private async void MainPage_Loaded(object sender, RoutedEventArgs e) { //make title bar transparent ApplicationViewTitleBar formattableTitleBar = ApplicationView.GetForCurrentView().TitleBar; formattableTitleBar.ButtonBackgroundColor = Colors.Transparent; CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar; coreTitleBar.ExtendViewIntoTitleBar = true; var lastVersion = System.Enum.GetValues(typeof(VersionLevel)).Cast <VersionLevel>().LastOrDefault(); object versionLevelObj; VersionLevel versionLevel = VersionLevel.Ver_1_1; ApplicationData.Current.LocalSettings.Values.TryGetValue(versionLevelKey, out versionLevelObj); System.Enum.TryParse <VersionLevel>(versionLevelObj?.ToString(), out versionLevel); if (versionLevel < lastVersion) { FTUEDialog dialog = new FTUEDialog(versionLevel); await dialog.ShowAsync(); ApplicationData.Current.LocalSettings.Values[versionLevelKey] = lastVersion.ToString(); } }
internal void IncreaseVersion(VersionLevel level, int revision, bool recursive = false) { if (level == VersionLevel.Revision) { this.NewVersion = new Version(this.Version.Major, this.Version.Minor, this.Version.Build, revision); } else if (level == VersionLevel.Build) { this.NewVersion = new Version(this.Version.Major, this.Version.Minor, this.Version.Build + 1, revision); } else if (level == VersionLevel.Minor) { this.NewVersion = new Version(this.Version.Major, this.Version.Minor + 1, 0, revision); } else if (level == VersionLevel.Major) { this.NewVersion = new Version(this.Version.Major + 1, 0, 0, revision); } if (recursive) { foreach (var dep in this.Dependents) { dep.IncreaseVersion(level, revision, recursive); } } }
public FTUEDialog(VersionLevel versionLevel) { this.InitializeComponent(); var items = versionLevel == VersionLevel.Ver_1_1 ? FTUEItem.Items.TakeWhile(x => !x.IsUpgradeOnly) : // FTUE items FTUEItem.Items.TakeWhile(x => x.RequiredVersionLevel > versionLevel); // Upgrade items Items = new ObservableCollection <FTUEItem>(items.ToList()); this.Title = LottoryUWP.Strings.Resources.FTUE_Title_New; }
public bool IsNewer(ProgamVersion otherVersion, VersionLevel level) { if (level == VersionLevel.Build) { return(this.IsNewer(otherVersion)); } if (level == VersionLevel.Revision) { this.Build = 0; otherVersion.Build = 0; return(this.IsNewer(otherVersion)); } if (level == VersionLevel.Minor) { this.Build = 0; otherVersion.Build = 0; this.Revision = 0; otherVersion.Revision = 0; return(this.IsNewer(otherVersion)); } if (level == VersionLevel.Major) { this.Build = 0; otherVersion.Build = 0; this.Revision = 0; otherVersion.Revision = 0; this.Minor = 0; otherVersion.Minor = 0; return(this.IsNewer(otherVersion)); } return(false); }
public bool IsNewer(string version, VersionLevel level) { ProgamVersion otherVersion = new ProgamVersion(version); return(this.IsNewer(otherVersion, level)); }