New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Trizbort to detect if file version > app version #353

Closed
andrewschultz opened this Issue Jul 3, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@andrewschultz
Collaborator

andrewschultz commented Jul 3, 2017

It seems like it would be useful to make a popup box to warn the user information may be lost, and I already wrote code to put something out there, but I wanted to make an issue before dropping a pull request out of the blue.

If this is a good feature, I'd be open to changing what we should put in the popup box e.g. a link to Trizbort.com etc.

Line 186 in project.cs: checkDocVersion();

    public void checkDocVersion()
   {
        var AppVers = Version.Parse(Application.ProductVersion);
        var infoList = $"Executable Version = {Application.ProductVersion}{Environment.NewLine}Document Version = {Version.ToString()}{Environment.NewLine}";

        if (Version.Major < AppVers.Major) return;
        if (Version.Major > AppVers.Major)
        {
          MessageBox.Show(Program.MainForm,
            string.Format($"{infoList}The document is ahead a major version. Information is very likely to be lost."), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
          return;
        }

        if (Version.Minor < AppVers.Minor) return;
        if (Version.Minor > AppVers.Minor)
        {
          MessageBox.Show(Program.MainForm,
            string.Format($"{infoList}The document is ahead a minor version. Information is likely to be lost."), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
          return;
        }

        if (Version.Build < AppVers.Build) return;
        if (Version.Build > AppVers.Build)
        {
            MessageBox.Show(Program.MainForm,
            string.Format($"{infoList}The document is ahead a build. Information is somewhat likely to be lost."), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            return;
        }

        if (Version.MinorRevision < AppVers.MinorRevision) return;
        if (Version.MinorRevision > AppVers.MinorRevision)
        {
            MessageBox.Show(Program.MainForm,
            string.Format($"{infoList}The document is ahead a minor revision. Information may possibly be lost."), Application.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error);
            return;
        }
    }
@JasonLautzenheiser

This comment has been minimized.

Owner

JasonLautzenheiser commented Jul 3, 2017

I think a simple messagebox is fine for now....we can always make it look better / add more information later.

@JasonLautzenheiser

This comment has been minimized.

Owner

JasonLautzenheiser commented Jul 7, 2017

This is added in #359

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment