コード例 #1
0
        public License Deserialize(string key, IDecoder decoder)
        {
            byte[]  data   = Base32Decoder.Decode(key);
            byte[]  buffer = decoder.Decode(data);
            License result;

            using (MemoryStream memoryStream = new MemoryStream(buffer))
            {
                License license = NewLicenseSerializer.ReadLicenseFromStream(memoryStream);
                result = license;
            }
            return(result);
        }
コード例 #2
0
        public License Deserialize(string key, IDecoder decoder)
        {
            byte[] array = Base32Decoder.Decode(key);
            if (OldLicenseSerializer.IsEmpty(array))
            {
                return(null);
            }
            byte[] array2 = decoder.Decode(array);
            if (OldLicenseSerializer.IsEmpty(array2))
            {
                return(null);
            }
            License result;

            using (MemoryStream memoryStream = new MemoryStream(array2))
            {
                License license = OldLicenseSerializer.ReadLicenseFromStream(memoryStream);
                result = license;
            }
            return(result);
        }