-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathDiagram.cs
43 lines (31 loc) · 1.08 KB
/
Diagram.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
// Copyright (c) Microsoft. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Threading;
namespace Microsoft.Azure.SignalR.Samples.Whiteboard
{
public class Diagram
{
public class Shape
{
public string Kind { get; set; }
public string Color { get; set; }
public int Width { get; set; }
public List<int> Data { get; set; }
}
private int totalUsers = 0;
public byte[] Background { get; set; }
public string BackgroundContentType { get; set; }
public string BackgroundId { get; set; }
public ConcurrentDictionary<string, Shape> Shapes { get; } = new ConcurrentDictionary<string, Shape>();
public int UserEnter()
{
return Interlocked.Increment(ref totalUsers);
}
public int UserLeave()
{
return Interlocked.Decrement(ref totalUsers);
}
}
}