public AccountsRegenerateKeyExample()
        {
            this.SubscriptionId    = DefaultSubscriptionId;
            this.ResourceGroupName = DefaultResourceGroupName;
            this.AccountName       = DefaultAccountName;
            this.ApiVersion        = ApiVersionStore.DefaultApiVersion;
            this.Parameters        = new RegenerateKeyParameter
            {
                Name = DefaultKeys.First().Name,
                Rank = DefaultKeys.First().Rank
            };

            this.Response = new ResponseModel
            {
                StatusCode = HttpStatusCode.OK,
                Body       = DefaultKeys.First()
            };
        }
Пример #2
0
        public override SoundInput TryOpen(IBinaryStream file)
        {
            if (!file.Name.HasAnyOfExtensions(RequiredExtensions))
            {
                return(null);
            }
            var ext = Path.GetExtension(file.Name).TrimStart('.').ToLowerInvariant();

            byte[] key;
            if (!DefaultKeys.TryGetValue(ext, out key))
            {
                return(null);
            }
            var    header     = file.ReadHeader(0x14);
            int    fmt_length = header.ToInt32(0x10);
            int    data_pos   = 0x14 + fmt_length;
            var    wav_header = file.ReadHeader(data_pos + 8).ToArray();
            Stream data       = new StreamRegion(file.AsStream, file.Position);

            data = new ByteStringEncryptedStream(data, key);
            data = new PrefixStream(wav_header, data);
            return(new WaveInput(data));
        }