blob: af08737358852e10c14e3b603f7f0f9f355623e1 (
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
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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
|
//
// System.Security.Permissions.SiteIdentityPermission.cs
//
// Author
// Sebastien Pouliot <spouliot@motus.com>
//
// Copyright (C) 2003 Motus Technologies. http://www.motus.com
//
using System;
using System.Globalization;
namespace System.Security.Permissions {
[Serializable]
public sealed class SiteIdentityPermission : CodeAccessPermission, IBuiltInPermission {
private string _site;
// Constructors
public SiteIdentityPermission (PermissionState state)
{
}
public SiteIdentityPermission (string site)
{
_site = site;
}
// Properties
public string Site {
get { return _site; }
set { _site = value; }
}
// Methods
public override IPermission Copy ()
{
return new SiteIdentityPermission (_site);
}
public override void FromXml (SecurityElement esd)
{
if (esd == null)
throw new ArgumentNullException (
Locale.GetText ("The argument is null."));
if (esd.Attribute ("class") != GetType ().AssemblyQualifiedName)
throw new ArgumentException (
Locale.GetText ("The argument is not valid"));
if (esd.Attribute ("version") != "1")
throw new ArgumentException (
Locale.GetText ("The argument is not valid"));
this.Site = esd.Attribute ("Site");
}
[MonoTODO]
public override IPermission Intersect (IPermission target)
{
return null;
}
[MonoTODO]
public override bool IsSubsetOf (IPermission target)
{
return false;
}
public override SecurityElement ToXml ()
{
SecurityElement e = new SecurityElement ("IPermission");
e.AddAttribute ("class", GetType ().AssemblyQualifiedName);
e.AddAttribute ("version", "1");
e.AddAttribute ("Site", _site);
return e;
}
[MonoTODO]
public override IPermission Union (IPermission target)
{
return null;
}
// IBuiltInPermission
int IBuiltInPermission.GetTokenIndex ()
{
return 10;
}
}
}
|