-
Notifications
You must be signed in to change notification settings - Fork 94
/
Copy pathEditSession.cs
79 lines (71 loc) · 1.92 KB
/
EditSession.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Security.Cryptography;
namespace WopiCobaltHost
{
abstract public class EditSession
{
protected readonly string m_sessionId;
protected readonly string m_login;
protected readonly string m_name;
protected readonly string m_email;
protected readonly bool m_isAnonymous;
protected readonly FileInfo m_fileinfo;
protected DateTime m_lastUpdated;
public EditSession(string sessionId, string filePath, string login, string name, string email, bool isAnonymous)
{
m_sessionId = sessionId;
m_fileinfo = new FileInfo(filePath);
m_name = name;
m_login = login;
m_email = email;
m_isAnonymous = isAnonymous;
}
public string SessionId
{
get { return m_sessionId; }
set { }
}
public string Login
{
get { return m_login; }
set { }
}
public string Name
{
get { return m_name; }
set { }
}
public string Email
{
get { return m_email; }
set { }
}
public bool IsAnonymous
{
get { return m_isAnonymous; }
set { }
}
public DateTime LastUpdated
{
get { return m_lastUpdated; }
set { }
}
public long FileLength
{
get
{
return m_fileinfo.Length;
}
}
abstract public WopiCheckFileInfo GetCheckFileInfo();
abstract public byte[] GetFileContent();
virtual public void Save(byte[] new_content) { }
virtual public void Dispose() { }
virtual public void Save() { }
}
}