예제 #1
0
 private static void ValidateContextAndConfigNotNull(
     AxUtilContext context,
     AxUtilConfiguration config)
 {
     AxUtil.ValidateContextNotNull(context);
     AxUtil.ValidateConfigNotNull(config);
 }
예제 #2
0
 public AxUtil(AxUtilContext context, AxUtilConfiguration config)
     : this()
 {
     AxUtil.ValidateContextAndConfigNotNull(context, config);
     this.Context = context;
     this.Config  = config;
 }
예제 #3
0
 private static void ValidateConfigNotNull(AxUtilConfiguration config)
 {
     if (config == null)
     {
         throw new ArgumentNullException(nameof(config));
     }
 }
        internal LicenseGenerator(AxUtilConfiguration configuration, AxUtilContext context)
        {
            this.licenseInfo      = configuration.LicenseInfo;
            this.context          = context;
            this.SignatureVersion = configuration.SignatureVersion;
            NumberFormatInfo numberFormat = CultureInfo.InvariantCulture.NumberFormat;
            int num;

            if (this.licenseInfo.ExpirationDate.HasValue)
            {
                DateTime dateTime = this.licenseInfo.ExpirationDate.Value;
                string[] strArray = new string[5];
                num                = dateTime.Day;
                strArray[0]        = num.ToString((IFormatProvider)numberFormat);
                strArray[1]        = ".";
                num                = dateTime.Month;
                strArray[2]        = num.ToString((IFormatProvider)numberFormat);
                strArray[3]        = ".";
                num                = dateTime.Year;
                strArray[4]        = num.ToString((IFormatProvider)numberFormat);
                this.formattedDate = string.Concat(strArray);
            }
            if (this.licenseInfo.UserCount.HasValue)
            {
                int?userCount = this.licenseInfo.UserCount;
                num = 0;
                if (userCount.GetValueOrDefault() > num & userCount.HasValue)
                {
                    num = this.licenseInfo.UserCount.Value;
                    this.formattedUserCount = num.ToString((IFormatProvider)numberFormat);
                    goto label_6;
                }
            }
            this.formattedUserCount = string.Empty;
label_6:
            string[] strArray1 = new string[5];
            num          = this.licenseInfo.Timestamp.Day;
            strArray1[0] = num.ToString((IFormatProvider)numberFormat);
            strArray1[1] = ".";
            DateTime timestamp = this.licenseInfo.Timestamp;

            num                     = timestamp.Month;
            strArray1[2]            = num.ToString((IFormatProvider)numberFormat);
            strArray1[3]            = ".";
            timestamp               = this.licenseInfo.Timestamp;
            num                     = timestamp.Year;
            strArray1[4]            = num.ToString((IFormatProvider)numberFormat);
            this.formattedTimestamp = string.Concat(strArray1);
        }