System.Security.Permissions.IsolatedStoragePermission.FromXml C# (CSharp) Method

FromXml() public method

public FromXml ( SecurityElement esd ) : void
esd System.Security.SecurityElement
return void
        public override void FromXml(SecurityElement esd)
        {
            CodeAccessPermission.ValidateElement( esd, this );

            m_allowed = IsolatedStorageContainment.None;    // default if no match

            if (XMLUtil.IsUnrestricted(esd))
            {
                m_allowed = IsolatedStorageContainment.UnrestrictedIsolatedStorage;
            }
            else
            {
                String allowed = esd.Attribute( "Allowed" );

                if (allowed != null)
                    m_allowed = (IsolatedStorageContainment)Enum.Parse( typeof( IsolatedStorageContainment ), allowed );
            }
                    
            if (m_allowed == IsolatedStorageContainment.UnrestrictedIsolatedStorage)
            {
                m_userQuota = Int64.MaxValue;
                m_machineQuota = Int64.MaxValue;
                m_expirationDays = Int64.MaxValue ;
                m_permanentData = true;
            }
            else 
            {
                String param;
                param = esd.Attribute (_strUserQuota) ;
                m_userQuota = param != null ? Int64.Parse(param, CultureInfo.InvariantCulture) : 0 ;
                param = esd.Attribute (_strMachineQuota) ;
                m_machineQuota = param != null ? Int64.Parse(param, CultureInfo.InvariantCulture) : 0 ;
                param = esd.Attribute (_strExpiry) ;
                m_expirationDays = param != null ? Int64.Parse(param, CultureInfo.InvariantCulture) : 0 ;
                param = esd.Attribute (_strPermDat) ;
                m_permanentData = param != null ? (Boolean.Parse(param)) : false ;
            }
        }
    }