-
-
Notifications
You must be signed in to change notification settings - Fork 50
/
Copy pathELARAccessProtocol.cs
51 lines (43 loc) · 1.25 KB
/
ELARAccessProtocol.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
using System;
namespace SIL.Archiving.Generic.AccessProtocol
{
/// <summary>Access protocol for ELAR (Endangered Languages Archive)</summary>
/// <see cref="http://www.elar-archive.org/depositing/preparing-access-protocol.php"/>
public class ElarAccessProtocol : AccessProtocolBase, IAccessProtocol
{
protected AccessOption _access;
/// <summary>List of access options for The Language Archive</summary>
public enum AccessOption
{
/// <summary>all Users can access</summary>
U,
/// <summary>Researchers and Community members are allowed access</summary>
R,
/// <summary>only Community members are allowed access</summary>
C,
/// <summary>only Subscribers are allowed access</summary>
S
}
/// <summary>Who has access, and how do you get access</summary>
public ElarAccessProtocol(AccessOption access)
{
_access = access;
}
/// <summary>Returns the code to use in the archive package</summary>
public string GetAccessCode()
{
switch (_access)
{
case AccessOption.U:
return "U";
case AccessOption.R:
return "R";
case AccessOption.C:
return "C";
case AccessOption.S:
return "S";
}
throw new NotSupportedException("The selected access protocol is not supported.");
}
}
}