// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
-#if NET_2_0
using System;
using System.Security;
using System.Security.Permissions;
{
}
- [MonoTODO]
+ [MonoTODO ("verify implementation")]
public override IPermission CreatePermission ()
{
- throw new NotImplementedException ();
+ NetworkInformationAccess a = NetworkInformationAccess.None;
+ switch (Access) {
+ case "Read":
+ a = NetworkInformationAccess.Read;
+ break;
+ case "Full":
+ a = NetworkInformationAccess.Read | NetworkInformationAccess.Ping;
+ break;
+ }
+ return new NetworkInformationPermission (a);
}
public string Access {
get { return access; }
- set { access = value; }
+ set {
+ switch (access) {
+ case "Read":
+ case "Full":
+ case "None":
+ break;
+ default:
+ throw new ArgumentException ("Only 'Read', 'Full' and 'None' are allowed");
+ }
+ access = value;
+ }
}
}
}
-#endif