-
Notifications
You must be signed in to change notification settings - Fork 371
/
CloudQueueMessage.cs
57 lines (54 loc) · 2.34 KB
/
CloudQueueMessage.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// -----------------------------------------------------------------------------------------
// <copyright file="CloudQueueMessage.cs" company="Microsoft">
// Copyright 2013 Microsoft Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// </copyright>
// -----------------------------------------------------------------------------------------
namespace Microsoft.Azure.Storage.Queue
{
using System;
#if !(NETCORE)
using System.Runtime.InteropServices.WindowsRuntime;
#endif
public sealed partial class CloudQueueMessage
{
/// <summary>
/// Initializes a new instance of the <see cref="CloudQueueMessage"/> class with the given byte array.
/// </summary>
/// <param name="content">The content of the message as a byte array.</param>
/// <returns>The new message as a <see cref="CloudQueueMessage"/> object.</returns>
[Obsolete("Use new CloudQueueMessage(Convert.ToBase64String(content), true)")]
#if NETCORE
public static CloudQueueMessage CreateCloudQueueMessageFromByteArray(byte[] content)
#else
public static CloudQueueMessage CreateCloudQueueMessageFromByteArray([ReadOnlyArray] byte[] content)
#endif
{
return new CloudQueueMessage(Convert.ToBase64String(content), true);
}
/// <summary>
/// Sets the content of this message.
/// </summary>
/// <param name="content">The new message content.</param>
[Obsolete("Use SetMessageContent2(Convert.ToBase64String(content), true)")]
#if NETCORE
public void SetMessageContent(byte[] content)
#else
[Windows.Foundation.Metadata.DefaultOverloadAttribute]
public void SetMessageContent([ReadOnlyArray] byte[] content)
#endif
{
this.SetMessageContent2(Convert.ToBase64String(content), true);
}
}
}