OUT-130: Make GetPEPVersion() method to be used in ribbon also.
authorDean
Sat, 15 Oct 2016 16:19:38 +0200
changeset 1366dc9bdb3f6e07
parent 1363 08ce4198bffd
child 1367 1aa823105f05
OUT-130: Make GetPEPVersion() method to be used in ribbon also.
Globals.cs
UI/RibbonCustomizations.cs
     1.1 --- a/Globals.cs	Fri Oct 14 16:34:00 2016 +0200
     1.2 +++ b/Globals.cs	Sat Oct 15 16:19:38 2016 +0200
     1.3 @@ -295,6 +295,30 @@
     1.4          }
     1.5  
     1.6          /// <summary>
     1.7 +        /// Gets the pEp for Outlook version.
     1.8 +        /// This will never be null.
     1.9 +        /// </summary>
    1.10 +        /// <returns>The version string.</returns>
    1.11 +        public static string GetPEPVersion()
    1.12 +        {
    1.13 +            string version;
    1.14 +            string updateLevel;
    1.15 +
    1.16 +            // Build the version string
    1.17 +            updateLevel = Properties.Settings.Default.UpdateLevel;
    1.18 +            version = string.Empty;
    1.19 +            version += Assembly.GetExecutingAssembly().GetName().Version.Major.ToString();
    1.20 +            version += "." + Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString();
    1.21 +
    1.22 +            if (string.IsNullOrWhiteSpace(updateLevel) == false)
    1.23 +            {
    1.24 +                version += " Update " + updateLevel;
    1.25 +            }
    1.26 +
    1.27 +            return (version);
    1.28 +        }
    1.29 +
    1.30 +        /// <summary>
    1.31          /// Gets the current system information string.
    1.32          /// </summary>
    1.33          /// <returns>The system information as a string.</returns>
    1.34 @@ -327,9 +351,8 @@
    1.35          public static List<KVPair<string, string>> GetSystemInfoList()
    1.36          {
    1.37              string serial;
    1.38 -            string version;
    1.39 +            string version = Globals.GetPEPVersion();
    1.40              string engineVersion;
    1.41 -            string updateLevel;
    1.42              List<KVPair<string, string>> systemInfo = new List<KVPair<string, string>>();
    1.43              Office.LanguageSettings lang = null;
    1.44  
    1.45 @@ -337,17 +360,6 @@
    1.46              {
    1.47                  lang = Globals.ThisAddIn.Application.LanguageSettings;
    1.48  
    1.49 -                // Build the version string
    1.50 -                updateLevel = Properties.Settings.Default.UpdateLevel;
    1.51 -                version = string.Empty;
    1.52 -                version += Assembly.GetExecutingAssembly().GetName().Version.Major.ToString();
    1.53 -                version += "." + Assembly.GetExecutingAssembly().GetName().Version.Minor.ToString();
    1.54 -
    1.55 -                if (string.IsNullOrWhiteSpace(updateLevel) == false)
    1.56 -                {
    1.57 -                    version += " Update " + updateLevel;
    1.58 -                }
    1.59 -
    1.60                  // Get the engine version
    1.61                  try
    1.62                  {
     2.1 --- a/UI/RibbonCustomizations.cs	Fri Oct 14 16:34:00 2016 +0200
     2.2 +++ b/UI/RibbonCustomizations.cs	Sat Oct 15 16:19:38 2016 +0200
     2.3 @@ -747,7 +747,7 @@
     2.4          /// </summary>
     2.5          public string LabelControlVersion_GetLabel(Office.IRibbonControl control)
     2.6          {
     2.7 -            return (Assembly.GetExecutingAssembly().GetName().Version.ToString());
     2.8 +            return (Globals.GetPEPVersion());
     2.9          }
    2.10  
    2.11          /// <summary>