System.Security.PermissionSetCollection.FromXml C# (CSharp) Method

FromXml() public method

public FromXml ( SecurityElement el ) : void
el SecurityElement
return void
		public void FromXml (SecurityElement el) 
		{
			if (el == null)
				throw new ArgumentNullException ("el");
			if (el.Tag != tagName) {
				string msg = String.Format ("Invalid tag {0} expected {1}", el.Tag, tagName);
				throw new ArgumentException (msg, "el");
			}
			_list.Clear ();
			if (el.Children != null) {
				foreach (SecurityElement child in el.Children) {
					PermissionSet ps = new PermissionSet (PermissionState.None);
					ps.FromXml (child);
					_list.Add (ps);
				}
			}
		}

Usage Example

		public void FromXml_BadName ()
		{
			PermissionSetCollection psc = new PermissionSetCollection ();
			SecurityElement se = new SecurityElement ("PermissionZetCollection");
			psc.FromXml (se);
		}
All Usage Examples Of System.Security.PermissionSetCollection::FromXml