2004-09-10 Sebastien Pouliot <sebastien@ximian.com>
[mono.git] / mcs / class / System.Messaging / System.Messaging / MessageQueuePermissionEntry.cs
1 //\r
2 // System.Messaging.MessageQueuePermissionEntry.cs\r
3 //\r
4 // Authors:\r
5 //      Peter Van Isacker (sclytrack@planetinternet.be)\r
6 //      Sebastien Pouliot  <sebastien@ximian.com>
7 //\r
8 // (C) 2003 Peter Van Isacker\r
9 // Copyright (C) 2004 Novell, Inc (http://www.novell.com)
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 namespace System.Messaging {
32 \r
33         [Serializable]\r
34         public class MessageQueuePermissionEntry {
35
36                 private MessageQueuePermissionAccess _permissionAccess;
37                 private string _machineName;
38                 private string _label;
39                 private string _category;
40                 private string _path;
41 \r
42                 public MessageQueuePermissionEntry (MessageQueuePermissionAccess permissionAccess, string path)\r
43                 {
44                         if (path == null)
45                                 throw new ArgumentNullException ("path");\r
46                         MessageQueuePermission.ValidatePath (path);
47
48                         _permissionAccess = permissionAccess;
49                         _path = path;\r
50                 }\r
51                 \r
52                 public MessageQueuePermissionEntry (MessageQueuePermissionAccess permissionAccess, string machineName, string label, string category)\r
53                 {
54                         if (machineName == null)
55                                 throw new ArgumentNullException ("machineName");\r
56                         MessageQueuePermission.ValidateMachineName (machineName);
57
58                         _permissionAccess = permissionAccess;
59                         _machineName = machineName;
60                         _label = label;
61                         _category = category;
62                 }\r
63                 \r
64                 public string Category {\r
65                         get { return _category; }\r
66                 }\r
67                 \r
68                 public string Label {\r
69                         get { return _label; }\r
70                 }\r
71 \r
72                 public string MachineName {\r
73                         get { return _machineName; }\r
74                 }\r
75                 \r
76                 public string Path {\r
77                         get { return _path; }\r
78                 }\r
79                 \r
80                 public MessageQueuePermissionAccess PermissionAccess {\r
81                         get { return _permissionAccess; }\r
82                 }\r
83         }\r
84 }\r