1 | // -----------------------------------------------------------------------
|
---|
2 | // <copyright file="SharedConstants.cs" company="Microsoft">
|
---|
3 | // Copyright (c) Microsoft Corporation. All rights reserved.
|
---|
4 | // </copyright>
|
---|
5 | // -----------------------------------------------------------------------
|
---|
6 |
|
---|
7 | namespace Microsoft.Samples.Kinect.Webserver
|
---|
8 | {
|
---|
9 | using System.Threading.Tasks;
|
---|
10 |
|
---|
11 | /// <summary>
|
---|
12 | /// Placeholder class that declares commonly used constants and configuration values.
|
---|
13 | /// </summary>
|
---|
14 | internal static class SharedConstants
|
---|
15 | {
|
---|
16 | /// <summary>
|
---|
17 | /// Invalid tracking identifier.
|
---|
18 | /// </summary>
|
---|
19 | internal const int InvalidUserTrackingId = 0;
|
---|
20 |
|
---|
21 | /// <summary>
|
---|
22 | /// Maximum number of users that can get assigned a skeleton tracking id.
|
---|
23 | /// </summary>
|
---|
24 | internal const int MaxUsersTracked = 6;
|
---|
25 |
|
---|
26 | /// <summary>
|
---|
27 | /// Array of standard character delimiters used to separate path components in a URI
|
---|
28 | /// string.
|
---|
29 | /// </summary>
|
---|
30 | internal static readonly char[] UriPathComponentDelimiters = new[] { '/', '?' };
|
---|
31 |
|
---|
32 | /// <summary>
|
---|
33 | /// Empty task with a <see cref="TaskStatus.RanToCompletion"/> status, so awaiting
|
---|
34 | /// on task will return immediately.
|
---|
35 | /// </summary>
|
---|
36 | /// <remarks>
|
---|
37 | /// This is a helper value to be returned from synchronous functions that implement
|
---|
38 | /// an asynchronous contract, so clients can always await without needing to check
|
---|
39 | /// for null.
|
---|
40 | /// </remarks>
|
---|
41 | internal static readonly Task EmptyCompletedTask = Task.FromResult(0);
|
---|
42 |
|
---|
43 | /// <summary>
|
---|
44 | /// Create a new task that will block all clients awaiting on it until
|
---|
45 | /// <see cref="Task.Start()"/> is called on it.
|
---|
46 | /// </summary>
|
---|
47 | /// <returns>
|
---|
48 | /// New await-able task.
|
---|
49 | /// </returns>
|
---|
50 | internal static Task CreateNonstartedTask()
|
---|
51 | {
|
---|
52 | return new Task(() => { });
|
---|
53 | }
|
---|
54 | }
|
---|
55 | }
|
---|