Beispiel #1
0
        private void showWhatsNew()
        {
            // 1st time users: Settings.FileAssoc is null -and- Settings.Version is null or white space.
            // prev users: Settings.FileAssoc is not null -or- Settings.Version is not null or white space
            bool update = !Settings.FileAssoc.IsNull() || !Settings.Version.IsNullOrWhiteSpace();

            if (update)
            {
                bool show = false;
                Version.TryParse(Settings.Version, out var version);
                if (version is null || version < AssemblyVersion)
                {
                    show = true;
                }

                if (show)
                {
                    var dlg = new WhatsNewForm {
                        Owner = this
                    };
                    dlg.ShowDialog();

                    Settings.Version = AssemblyVersion.ToString();
                    Settings.Save();
                }
            }
            else
            {
                Settings.Version = AssemblyVersion.ToString();
                Settings.Save();
            }
        }
Beispiel #2
0
        private void showWhatsNew()
        {
            // Window should only be shown to existing users after update.
            // Version should be saved to settings for new users as well.

            // new users: Settings.FileAssoc is null -and- Settings.Version is null or white space.
            bool newuser = Settings.FileAssoc.IsNull() && Settings.Version.IsNullOrWhiteSpace();

            // update: settings version number is null or lower than assembly
            Version.TryParse(Settings.Version, out var version);
            bool update = version is null || version < AssemblyVersion;

            bool show = update && !newuser;

            if (show)
            {
                var dlg = new WhatsNewForm {
                    Owner = this
                };
                dlg.ShowDialog();
            }

            if (update)
            {
                Settings.Version = AssemblyVersion.ToString();
                Settings.Save();
            }
        }