blob: 29163f72b4a99dbe31b4de44a583274bc4e18afb (
plain)
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
|
//-----------------------------------------------------------------------
// <copyright file="MessageProtectionTasks.cs" company="Andrew Arnott">
// Copyright (c) Andrew Arnott. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
namespace DotNetOpenAuth.Messaging {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
/// <summary>
/// Reusable pre-completed tasks that may be returned multiple times to reduce GC pressure.
/// </summary>
internal static class MessageProtectionTasks {
/// <summary>
/// A task whose result is <c>null</c>
/// </summary>
internal static readonly Task<MessageProtections?> Null = Task.FromResult<MessageProtections?>(null);
/// <summary>
/// A task whose result is <see cref="MessageProtections.None"/>
/// </summary>
internal static readonly Task<MessageProtections?> None =
Task.FromResult<MessageProtections?>(MessageProtections.None);
/// <summary>
/// A task whose result is <see cref="MessageProtections.TamperProtection"/>
/// </summary>
internal static readonly Task<MessageProtections?> TamperProtection =
Task.FromResult<MessageProtections?>(MessageProtections.TamperProtection);
}
}
|