예제 #1
0
        public VersionStatus(ModMetaData mod)
        {
            version = mod.TargetVersion;
            if (!VersionControl.IsWellFormattedVersionString(mod.TargetVersion))
            {
                match = VersionMatch.InvalidVersion;
                tip   = I18n.InvalidVersion(version);
                return;
            }

            var _version = VersionControl.VersionFromString(version);

            if (_version.Major != VersionControl.CurrentMajor || _version.Minor != VersionControl.CurrentMinor)
            {
                match = VersionMatch.DifferentVersion;
                tip   = I18n.DifferentVersion(mod);
                return;
            }
            if (_version.Build != VersionControl.CurrentBuild)
            {
                match = VersionMatch.DifferentBuild;
                tip   = I18n.DifferentBuild(mod);
                return;
            }
            match = VersionMatch.CurrentVersion;
            tip   = I18n.CurrentVersion;
        }
예제 #2
0
 public static string Tip(ModMetaData mod, bool match, List <Version> versions)
 {
     if (match)
     {
         return(I18n.CurrentVersion);
     }
     else
     {
         return(I18n.DifferentVersion(mod));
     }
 }
예제 #3
0
        public static string Tip(ModMetaData mod, VersionMatch match, string version)
        {
            switch (match)
            {
            case VersionMatch.CurrentVersion:
                return(I18n.CurrentVersion);

            case VersionMatch.DifferentBuild:
                return(I18n.DifferentBuild(mod, version));

            case VersionMatch.DifferentVersion:
                return(I18n.DifferentVersion(mod, version));

            case VersionMatch.InvalidVersion:
            default:
                return(I18n.InvalidVersion(version));
            }
        }
예제 #4
0
 public static ModIssue DifferentVersion(ModButton_Installed button)
 {
     return(new ModIssue(Severity.Critical, Subject.Version, button, button.Identifier,
                         I18n.DifferentVersion(button.Selected)));
 }