FromXml() public method

public FromXml ( SecurityElement esd ) : void
esd System.Security.SecurityElement
return void
Ejemplo n.º 1
0
		public void FromXml_NoVersion ()
		{
			ZoneIdentityPermission zip = new ZoneIdentityPermission (PermissionState.None);
			SecurityElement se = zip.ToXml ();

			SecurityElement w = new SecurityElement (se.Tag);
			w.AddAttribute ("class", se.Attribute ("class"));
			zip.FromXml (w);
		}
Ejemplo n.º 2
0
		public void FromXml_NoClass ()
		{
			ZoneIdentityPermission zip = new ZoneIdentityPermission (PermissionState.None);
			SecurityElement se = zip.ToXml ();

			SecurityElement w = new SecurityElement (se.Tag);
			w.AddAttribute ("version", se.Attribute ("version"));
			zip.FromXml (w);
			// doesn't even care of the class attribute presence
		}
Ejemplo n.º 3
0
		public void FromXml_WrongTagCase ()
		{
			ZoneIdentityPermission zip = new ZoneIdentityPermission (PermissionState.None);
			SecurityElement se = zip.ToXml ();
			se.Tag = "IPERMISSION"; // instead of IPermission
			zip.FromXml (se);
		}
Ejemplo n.º 4
0
		public void FromXml_WrongClass ()
		{
			ZoneIdentityPermission zip = new ZoneIdentityPermission (PermissionState.None);
			SecurityElement se = zip.ToXml ();

			SecurityElement w = new SecurityElement (se.Tag);
			w.AddAttribute ("class", "Wrong" + se.Attribute ("class"));
			w.AddAttribute ("version", se.Attribute ("version"));
			zip.FromXml (w);
			// doesn't care of the class name at that stage
			// anyway the class has already be created so...
		}
Ejemplo n.º 5
0
		public void FromXml_Null ()
		{
			ZoneIdentityPermission zip = new ZoneIdentityPermission (PermissionState.None);
			zip.FromXml (null);
		}