| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384 |
- //
- // System.Security.Permissions.IsolatedStoragePermission.cs
- //
- // Piers Haken <[email protected]>
- //
- // (C) 2002 Ximian, Inc. http://www.ximian.com
- //
- using System;
- using System.Security.Permissions;
- namespace System.Security.Permissions
- {
- [Serializable]
- public abstract class IsolatedStoragePermission : CodeAccessPermission, IUnrestrictedPermission
- {
- internal long m_userQuota;
- internal long m_machineQuota;
- internal long m_expirationDays;
- internal bool m_permanentData;
- internal IsolatedStorageContainment m_allowed;
- public IsolatedStoragePermission (PermissionState state)
- {
- if (state == PermissionState.None)
- {
- m_userQuota = 0;
- m_machineQuota = 0;
- m_expirationDays = 0;
- m_permanentData = false;
- m_allowed = IsolatedStorageContainment.None;
- }
- else if (state == PermissionState.Unrestricted)
- {
- m_userQuota = Int64.MaxValue;
- m_machineQuota = Int64.MaxValue;
- m_expirationDays = Int64.MaxValue ;
- m_permanentData = true;
- m_allowed = IsolatedStorageContainment.UnrestrictedIsolatedStorage;
- }
- else
- {
- throw new ArgumentException("Invalid Permission state");
- }
- }
- public long UserQuota
- {
- set { m_userQuota = value; }
- get { return m_userQuota; }
- }
- public IsolatedStorageContainment UsageAllowed
- {
- set { m_allowed = value; }
- get { return m_allowed; }
- }
- public bool IsUnrestricted ()
- {
- return IsolatedStorageContainment.UnrestrictedIsolatedStorage == m_allowed;
- }
- [MonoTODO]
- public override SecurityElement ToXml ()
- {
- throw new NotImplementedException ();
- }
- [MonoTODO]
- public override void FromXml (SecurityElement esd)
- {
- throw new NotImplementedException ();
- }
- }
- }
|