public ExchangeServerAccessLicense(ExchangeServerAccessLicense.ServerVersionMajor versionMajor, ExchangeServerAccessLicense.AccessLicenseType accessLicense, ExchangeServerAccessLicense.UnitLabelType unitLabel, ExchangeServerAccessLicense.TabulationMethodType tabulationMethod) { this.VersionMajor = versionMajor; this.AccessLicense = accessLicense; this.UnitLabel = unitLabel; this.TabulationMethod = tabulationMethod; this.InternalInitialize(); }
public static bool TryParse(string licenseName, out ExchangeServerAccessLicense license) { license = null; if (string.IsNullOrEmpty(licenseName)) { return(false); } string[] array = licenseName.Split(new char[] { ' ' }); if (array.Length != 5) { return(false); } int num = 0; string productName = string.Format("{0} {1} {2}", array[num++], array[num++], array[num++]); KeyValuePair <ExchangeServerAccessLicense.ServerVersionMajor, string> keyValuePair = ExchangeServerAccessLicense.VersionMajorProductNameMap.SingleOrDefault((KeyValuePair <ExchangeServerAccessLicense.ServerVersionMajor, string> x) => x.Value.Equals(productName, StringComparison.InvariantCultureIgnoreCase)); if (keyValuePair.Equals(default(KeyValuePair <ExchangeServerAccessLicense.ServerVersionMajor, string>))) { return(false); } ExchangeServerAccessLicense.ServerVersionMajor key = keyValuePair.Key; ExchangeServerAccessLicense.AccessLicenseType accessLicense; if (!ExchangeServerAccessLicense.TryStringToEnum <ExchangeServerAccessLicense.AccessLicenseType>(array[num++], false, out accessLicense)) { return(false); } string text = array[num++]; ExchangeServerAccessLicense.UnitLabelType unitLabelType; if (text.Equals("Edition", StringComparison.InvariantCultureIgnoreCase)) { unitLabelType = ExchangeServerAccessLicense.UnitLabelType.Server; } else { if (!ExchangeServerAccessLicense.TryStringToEnum <ExchangeServerAccessLicense.UnitLabelType>(text, false, out unitLabelType)) { return(false); } if (unitLabelType == ExchangeServerAccessLicense.UnitLabelType.Server) { return(false); } } license = new ExchangeServerAccessLicense(key, accessLicense, unitLabelType); return(true); }
public ExchangeServerAccessLicense(ExchangeServerAccessLicense.ServerVersionMajor versionMajor, ExchangeServerAccessLicense.AccessLicenseType accessLicense, ExchangeServerAccessLicense.UnitLabelType unitLabel) : this(versionMajor, accessLicense, unitLabel, ExchangeServerAccessLicense.TabulationMethodType.Net) { }