private static string EditionsToString(string templateEditions) { string names = ""; string[] editions = templateEditions.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); foreach (string editionChar in editions) { try { // Add all editions to names ProductEditionEnum edition = editionChar.ToEnum <ProductEditionEnum>(); names += LicenseHelper.GetEditionName(edition) + ", "; } catch { return("#UNKNOWN#"); } } if (names == String.Empty) { return(String.Empty); } return(names.Substring(0, names.Length - 2)); }
private static string GetEditionName(string editionChar) { try { ProductEditionEnum edition = editionChar.ToEnum <ProductEditionEnum>(); return(LicenseHelper.GetEditionName(edition)); } catch { return("#UNKNOWN#"); } }
private static string GetEditionName(string editionChar) { try { ProductEditionEnum edition = LicenseKeyInfoProvider.CharToEdition(editionChar); return(LicenseHelper.GetEditionName(edition)); } catch { return("#UNKNOWN#"); } }
private static string EditionsToString(string templateEditions) { string names = ""; string[] editions = templateEditions.Split(new char[] { ';' }, StringSplitOptions.RemoveEmptyEntries); bool isProfInNames = false; foreach (string editionChar in editions) { try { // Add all editions to names // Prof and Pro3x has same resource string, ensure that this string will be only once in list ProductEditionEnum edition = editionChar.ToEnum <ProductEditionEnum>(); if ((edition != ProductEditionEnum.Professional) && (edition != ProductEditionEnum.Professional3x)) { names += LicenseHelper.GetEditionName(edition) + ", "; } else if (!isProfInNames) { names += LicenseHelper.GetEditionName(edition) + ", "; isProfInNames = true; } } catch { return("#UNKNOWN#"); } } if (names == "") { return(names); } else { return(names.Substring(0, names.Length - 2)); } }