2023-01-24 15:29:31 +01:00
|
|
|
|
/* Copyright (c) Cloud Software Group, Inc.
|
2020-01-22 15:47:39 +01:00
|
|
|
|
*
|
|
|
|
|
* Redistribution and use in source and binary forms,
|
|
|
|
|
* with or without modification, are permitted provided
|
|
|
|
|
* that the following conditions are met:
|
|
|
|
|
*
|
|
|
|
|
* * Redistributions of source code must retain the above
|
|
|
|
|
* copyright notice, this list of conditions and the
|
|
|
|
|
* following disclaimer.
|
|
|
|
|
* * Redistributions in binary form must reproduce the above
|
|
|
|
|
* copyright notice, this list of conditions and the
|
|
|
|
|
* following disclaimer in the documentation and/or other
|
|
|
|
|
* materials provided with the distribution.
|
|
|
|
|
*
|
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
|
|
|
|
|
* CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
|
|
|
|
|
* INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
|
|
|
|
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
|
|
|
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
|
|
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
|
|
|
|
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
|
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
|
|
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
|
|
|
|
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
|
* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
|
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
|
|
|
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using System.Diagnostics;
|
2023-01-14 03:38:18 +01:00
|
|
|
|
using System.Reflection;
|
2020-01-22 15:47:39 +01:00
|
|
|
|
using System.Resources;
|
2023-01-14 03:38:18 +01:00
|
|
|
|
using XenAdmin.Properties;
|
2020-01-22 15:47:39 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
namespace XenAdmin.Core
|
|
|
|
|
{
|
|
|
|
|
public class BrandManager
|
|
|
|
|
{
|
|
|
|
|
private static readonly ResourceManager Branding = new ResourceManager("XenAdmin.Branding", typeof(BrandManager).Assembly);
|
|
|
|
|
|
2023-01-14 03:38:18 +01:00
|
|
|
|
static BrandManager()
|
|
|
|
|
{
|
|
|
|
|
var assembly = Assembly.GetExecutingAssembly();
|
|
|
|
|
|
|
|
|
|
var customBranding = (CustomBrandingAttribute)assembly.GetCustomAttribute(typeof(CustomBrandingAttribute));
|
|
|
|
|
|
|
|
|
|
BrandConsole = customBranding.BrandConsole;
|
|
|
|
|
BrandConsoleNoSpace = customBranding.BrandConsoleNoSpace;
|
|
|
|
|
CompanyNameShort = customBranding.CompanyNameShort;
|
|
|
|
|
ProductBrand = customBranding.ProductBrand;
|
|
|
|
|
ProductVersionPost82 = customBranding.ProductVersionText;
|
|
|
|
|
UpdatesUrl = customBranding.UpdatesUrl;
|
|
|
|
|
VmTools = customBranding.VmTools;
|
|
|
|
|
XenHost = customBranding.XenHost;
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-22 15:47:39 +01:00
|
|
|
|
|
2023-01-14 03:38:18 +01:00
|
|
|
|
public static readonly string BrandConsole;
|
2020-01-22 15:47:39 +01:00
|
|
|
|
|
2023-01-14 03:38:18 +01:00
|
|
|
|
public static readonly string BrandConsoleNoSpace;
|
2021-07-25 15:49:50 +02:00
|
|
|
|
|
2021-03-16 02:50:45 +01:00
|
|
|
|
public static readonly string Cis = Get("CIS");
|
|
|
|
|
|
2023-01-15 18:11:45 +01:00
|
|
|
|
public static readonly string CompanyNameLegacy = Get("COMPANY_NAME_LEGACY");
|
|
|
|
|
|
2023-01-14 03:38:18 +01:00
|
|
|
|
public static readonly string CompanyNameShort;
|
2020-01-22 15:47:39 +01:00
|
|
|
|
|
2023-01-24 12:24:10 +01:00
|
|
|
|
public static readonly string Copyright = Get("COPYRIGHT");
|
|
|
|
|
|
2021-02-26 02:26:53 +01:00
|
|
|
|
public static readonly string ExtensionBackup = Get("EXTENSION_BACKUP");
|
2020-01-22 15:47:39 +01:00
|
|
|
|
|
2021-02-26 02:26:53 +01:00
|
|
|
|
public static readonly string ExtensionSearch = Get("EXTENSION_SEARCH");
|
2020-01-22 15:47:39 +01:00
|
|
|
|
|
2021-02-26 02:26:53 +01:00
|
|
|
|
public static readonly string ExtensionUpdate = Get("EXTENSION_UPDATE");
|
2020-01-22 15:47:39 +01:00
|
|
|
|
|
2021-06-02 03:09:06 +02:00
|
|
|
|
public static readonly string HelpPath = Get("HELP_PATH");
|
|
|
|
|
|
2021-02-26 02:26:53 +01:00
|
|
|
|
public static readonly string LegacyProduct = Get("LEGACY_PRODUCT");
|
2020-01-22 15:47:39 +01:00
|
|
|
|
|
2021-02-26 02:26:53 +01:00
|
|
|
|
public static readonly string PerfAlertMailDefaultLanguage = Get("PERF_ALERT_MAIL_DEFAULT_LANGUAGE");
|
2020-01-22 15:47:39 +01:00
|
|
|
|
|
2023-01-14 03:38:18 +01:00
|
|
|
|
public static readonly string ProductBrand;
|
2020-01-22 15:47:39 +01:00
|
|
|
|
|
2021-02-26 02:26:53 +01:00
|
|
|
|
public static readonly string ProductVersion56 = Get("PRODUCT_VERSION_5_6");
|
2020-02-24 13:59:39 +01:00
|
|
|
|
|
2021-02-26 02:26:53 +01:00
|
|
|
|
public static readonly string ProductVersion65 = Get("PRODUCT_VERSION_6_5");
|
2021-03-02 10:53:21 +01:00
|
|
|
|
|
2021-02-26 02:26:53 +01:00
|
|
|
|
public static readonly string ProductVersion70 = Get("PRODUCT_VERSION_7_0");
|
|
|
|
|
|
2023-01-15 15:08:53 +01:00
|
|
|
|
public static readonly string ProductVersion70Short = Get("PRODUCT_VERSION_7_0_SHORT");
|
|
|
|
|
|
|
|
|
|
public static readonly string ProductVersion712Short = Get("PRODUCT_VERSION_7_1_2_SHORT");
|
2021-02-26 02:26:53 +01:00
|
|
|
|
|
|
|
|
|
public static readonly string ProductVersion80 = Get("PRODUCT_VERSION_8_0");
|
|
|
|
|
|
|
|
|
|
public static readonly string ProductVersion81 = Get("PRODUCT_VERSION_8_1");
|
|
|
|
|
|
|
|
|
|
public static readonly string ProductVersion82 = Get("PRODUCT_VERSION_8_2");
|
|
|
|
|
|
2023-01-15 15:08:53 +01:00
|
|
|
|
public static readonly string ProductVersion82Short = Get("PRODUCT_VERSION_8_2_SHORT");
|
|
|
|
|
|
2021-10-08 00:31:42 +02:00
|
|
|
|
public static readonly string ProductVersion821 = Get("PRODUCT_VERSION_8_2_1");
|
|
|
|
|
|
2023-01-14 03:38:18 +01:00
|
|
|
|
public static readonly string ProductVersionPost82;
|
2021-02-26 02:26:53 +01:00
|
|
|
|
|
2022-12-10 02:49:11 +01:00
|
|
|
|
public static readonly string Trademarks = Get("TRADEMARKS");
|
|
|
|
|
|
2023-01-14 03:38:18 +01:00
|
|
|
|
public static readonly string UpdatesUrl;
|
2021-02-26 02:26:53 +01:00
|
|
|
|
|
2023-01-14 03:38:18 +01:00
|
|
|
|
public static readonly string VmTools;
|
2021-02-26 02:26:53 +01:00
|
|
|
|
|
2023-01-14 03:38:18 +01:00
|
|
|
|
public static readonly string XenHost;
|
2023-01-14 02:08:20 +01:00
|
|
|
|
|
2020-01-22 15:47:39 +01:00
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Returns null if no match is found.
|
|
|
|
|
/// </summary>
|
|
|
|
|
public static string Get(string s)
|
|
|
|
|
{
|
|
|
|
|
var result = Branding.GetString(s);
|
|
|
|
|
#if DEBUG
|
2023-01-14 03:38:18 +01:00
|
|
|
|
Debug.Assert(result != null, $"{s} doesn't exist in Branding");
|
2020-01-22 15:47:39 +01:00
|
|
|
|
#endif
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|