コード例 #1
0
 private static void VerifyZone(System.Security.SecurityZone zone)
 {
     if ((zone < System.Security.SecurityZone.NoZone) || (zone > System.Security.SecurityZone.Untrusted))
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_IllegalZone"));
     }
 }
コード例 #2
0
 public Zone(System.Security.SecurityZone zone)
 {
     if ((zone < System.Security.SecurityZone.NoZone) || (zone > System.Security.SecurityZone.Untrusted))
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_IllegalZone"));
     }
     this.m_zone = zone;
 }
コード例 #3
0
 public Zone(System.Security.SecurityZone zone)
 {
     if ((zone < System.Security.SecurityZone.NoZone) || (zone > System.Security.SecurityZone.Untrusted))
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_IllegalZone"));
     }
     this.m_zone = zone;
 }
コード例 #4
0
 private void OnSerialized(StreamingContext ctx)
 {
     if ((ctx.State & ~(StreamingContextStates.CrossAppDomain | StreamingContextStates.Clone)) != 0)
     {
         this.m_serializedPermission = null;
         this.m_zone = System.Security.SecurityZone.NoZone;
     }
 }
コード例 #5
0
 private void OnSerializing(StreamingContext ctx)
 {
     if ((ctx.State & ~(StreamingContextStates.CrossAppDomain | StreamingContextStates.Clone)) != 0)
     {
         this.m_serializedPermission = this.ToXml().ToString();
         this.m_zone = this.SecurityZone;
     }
 }
 public ZoneIdentityPermission(PermissionState state)
 {
     this.m_zone = System.Security.SecurityZone.NoZone;
     if (state == PermissionState.Unrestricted)
     {
         this.m_zones = 0x1f;
     }
     else
     {
         if (state != PermissionState.None)
         {
             throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPermissionState"));
         }
         this.m_zones = 0;
     }
 }
コード例 #7
0
 public ZoneIdentityPermission(PermissionState state)
 {
     this.m_zone = System.Security.SecurityZone.NoZone;
     if (state == PermissionState.Unrestricted)
     {
         this.m_zones = 0x1f;
     }
     else
     {
         if (state != PermissionState.None)
         {
             throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPermissionState"));
         }
         this.m_zones = 0;
     }
 }
 public void FromXml(SecurityElement e, PolicyLevel level)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     if (!e.Tag.Equals("IMembershipCondition"))
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_MembershipConditionElement"));
     }
     lock (this)
     {
         this.m_zone = System.Security.SecurityZone.NoZone;
         this.m_element = e;
     }
 }
コード例 #9
0
 public void FromXml(SecurityElement e, PolicyLevel level)
 {
     if (e == null)
     {
         throw new ArgumentNullException("e");
     }
     if (!e.Tag.Equals("IMembershipCondition"))
     {
         throw new ArgumentException(Environment.GetResourceString("Argument_MembershipConditionElement"));
     }
     lock (this)
     {
         this.m_zone    = System.Security.SecurityZone.NoZone;
         this.m_element = e;
     }
 }
コード例 #10
0
 private void OnDeserialized(StreamingContext ctx)
 {
     if ((ctx.State & ~(StreamingContextStates.CrossAppDomain | StreamingContextStates.Clone)) != 0)
     {
         if (this.m_serializedPermission != null)
         {
             this.FromXml(SecurityElement.FromString(this.m_serializedPermission));
             this.m_serializedPermission = null;
         }
         else
         {
             this.SecurityZone = this.m_zone;
             this.m_zone       = System.Security.SecurityZone.NoZone;
         }
     }
 }
コード例 #11
0
 private void ParseZone()
 {
     lock (this)
     {
         if (this.m_element != null)
         {
             string str = this.m_element.Attribute("Zone");
             this.m_zone = System.Security.SecurityZone.NoZone;
             if (str == null)
             {
                 throw new ArgumentException(Environment.GetResourceString("Argument_ZoneCannotBeNull"));
             }
             this.m_zone = (System.Security.SecurityZone)Enum.Parse(typeof(System.Security.SecurityZone), str);
             VerifyZone(this.m_zone);
             this.m_element = null;
         }
     }
 }
 private void OnSerializing(StreamingContext ctx)
 {
     if ((ctx.State & ~(StreamingContextStates.CrossAppDomain | StreamingContextStates.Clone)) != 0)
     {
         this.m_serializedPermission = this.ToXml().ToString();
         this.m_zone = this.SecurityZone;
     }
 }
コード例 #13
0
 private Zone(Zone zone)
 {
     this.m_url = zone.m_url;
     this.m_zone = zone.m_zone;
 }
コード例 #14
0
 private Zone(string url)
 {
     this.m_url  = url;
     this.m_zone = System.Security.SecurityZone.NoZone;
 }
 public ZoneIdentityPermission(System.Security.SecurityZone zone)
 {
     this.m_zone = System.Security.SecurityZone.NoZone;
     this.SecurityZone = zone;
 }
コード例 #16
0
 private Zone(Zone zone)
 {
     this.m_url  = zone.m_url;
     this.m_zone = zone.m_zone;
 }
コード例 #17
0
 internal ZoneIdentityPermission(uint zones)
 {
     this.m_zone  = System.Security.SecurityZone.NoZone;
     this.m_zones = zones & 0x1f;
 }
 internal ZoneIdentityPermission(uint zones)
 {
     this.m_zone = System.Security.SecurityZone.NoZone;
     this.m_zones = zones & 0x1f;
 }
 private void OnSerialized(StreamingContext ctx)
 {
     if ((ctx.State & ~(StreamingContextStates.CrossAppDomain | StreamingContextStates.Clone)) != 0)
     {
         this.m_serializedPermission = null;
         this.m_zone = System.Security.SecurityZone.NoZone;
     }
 }
コード例 #20
0
 internal ZoneMembershipCondition()
 {
     this.m_zone = System.Security.SecurityZone.NoZone;
 }
コード例 #21
0
 private Zone(string url)
 {
     this.m_url = url;
     this.m_zone = System.Security.SecurityZone.NoZone;
 }
コード例 #22
0
 public ZoneIdentityPermission(System.Security.SecurityZone zone)
 {
     this.m_zone       = System.Security.SecurityZone.NoZone;
     this.SecurityZone = zone;
 }
 internal ZoneMembershipCondition()
 {
     this.m_zone = System.Security.SecurityZone.NoZone;
 }
コード例 #24
0
 public ZoneMembershipCondition(System.Security.SecurityZone zone)
 {
     VerifyZone(zone);
     this.SecurityZone = zone;
 }
 private void ParseZone()
 {
     lock (this)
     {
         if (this.m_element != null)
         {
             string str = this.m_element.Attribute("Zone");
             this.m_zone = System.Security.SecurityZone.NoZone;
             if (str == null)
             {
                 throw new ArgumentException(Environment.GetResourceString("Argument_ZoneCannotBeNull"));
             }
             this.m_zone = (System.Security.SecurityZone) Enum.Parse(typeof(System.Security.SecurityZone), str);
             VerifyZone(this.m_zone);
             this.m_element = null;
         }
     }
 }
 private void OnDeserialized(StreamingContext ctx)
 {
     if ((ctx.State & ~(StreamingContextStates.CrossAppDomain | StreamingContextStates.Clone)) != 0)
     {
         if (this.m_serializedPermission != null)
         {
             this.FromXml(SecurityElement.FromString(this.m_serializedPermission));
             this.m_serializedPermission = null;
         }
         else
         {
             this.SecurityZone = this.m_zone;
             this.m_zone = System.Security.SecurityZone.NoZone;
         }
     }
 }