/// <summary> /// Creates a new Request using the parameters specified. /// </summary> /// <param name="subjects">The subjects list.</param> /// <param name="resources">The resource requested</param> /// <param name="action">The action requested.</param> /// <param name="environment">Any environment attribute part of the request.</param> /// <param name="schemaVersion">The version of the schema that was used to validate.</param> public RequestElementReadWrite( SubjectReadWriteCollection subjects, ResourceReadWriteCollection resources, ActionElementReadWrite action, EnvironmentElementReadWrite environment, XacmlVersion schemaVersion ) : base( XacmlSchema.Context, schemaVersion ) { _subjects = subjects; _resources = resources; _action = action; _environment = environment; }
/// <summary> /// Creates a new Request using the parameters specified. /// </summary> /// <param name="subjects">The subjects list.</param> /// <param name="resources">The resource requested</param> /// <param name="action">The action requested.</param> /// <param name="environment">Any environment attribute part of the request.</param> /// <param name="schemaVersion">The version of the schema that was used to validate.</param> public RequestElementReadWrite(SubjectReadWriteCollection subjects, ResourceReadWriteCollection resources, ActionElementReadWrite action, EnvironmentElementReadWrite environment, XacmlVersion schemaVersion) : base(XacmlSchema.Context, schemaVersion) { _subjects = subjects; _resources = resources; _action = action; _environment = environment; }
/// <summary> /// /// </summary> /// <param name="environment"></param> public Environment(con.EnvironmentElementReadWrite environment) { _environment = environment; this.Text = "Environment"; this.SelectedImageIndex = 2; this.ImageIndex = 2; foreach (con.AttributeElementReadWrite attr in _environment.Attributes) { this.Nodes.Add(new Attribute(attr)); } }
/// <summary> /// /// </summary> /// <param name="environment"></param> public Environment( con.EnvironmentElementReadWrite environment ) { _environment = environment; this.Text = "Environment"; this.SelectedImageIndex = 2; this.ImageIndex = 2; foreach( con.AttributeElementReadWrite attr in _environment.Attributes ) { this.Nodes.Add( new Attribute( attr ) ); } }
/// <summary> /// Creates a new Request using the XmlReader instance provided. /// </summary> /// <param name="reader">The XmlReader positioned at the Request node.</param> /// <param name="schemaVersion">The version of the schema that was used to validate.</param> public RequestElementReadWrite(XmlReader reader, XacmlVersion schemaVersion) : base(XacmlSchema.Context, schemaVersion) { if (reader == null) { throw new ArgumentNullException("reader"); } if (reader.LocalName == ContextSchema.RequestElement.Request) { while (reader.Read()) { switch (reader.LocalName) { case ContextSchema.RequestElement.Subject: _subjects.Add(new SubjectElementReadWrite(reader, schemaVersion)); break; case ContextSchema.RequestElement.Resource: _resources.Add(new ResourceElementReadWrite(reader, schemaVersion)); break; case ContextSchema.RequestElement.Action: _action = new ActionElementReadWrite(reader, schemaVersion); break; case ContextSchema.RequestElement.Environment: _environment = new EnvironmentElementReadWrite(reader, schemaVersion); break; } } } else { throw new Exception(Resource.ResourceManager[Resource.MessageKey.exc_invalid_node_name, reader.LocalName]); } }
/// <summary> /// Creates a new Request using the XmlReader instance provided. /// </summary> /// <param name="reader">The XmlReader positioned at the Request node.</param> /// <param name="schemaVersion">The version of the schema that was used to validate.</param> public RequestElementReadWrite( XmlReader reader, XacmlVersion schemaVersion ) : base( XacmlSchema.Context, schemaVersion ) { if (reader == null) throw new ArgumentNullException("reader"); if( reader.LocalName == ContextSchema.RequestElement.Request ) { while( reader.Read() ) { switch( reader.LocalName ) { case ContextSchema.RequestElement.Subject: _subjects.Add( new SubjectElementReadWrite( reader, schemaVersion ) ); break; case ContextSchema.RequestElement.Resource: _resources.Add( new ResourceElementReadWrite( reader, schemaVersion ) ); break; case ContextSchema.RequestElement.Action: _action = new ActionElementReadWrite( reader, schemaVersion ); break; case ContextSchema.RequestElement.Environment: _environment = new EnvironmentElementReadWrite( reader, schemaVersion ); break; } } } else { throw new Exception( Resource.ResourceManager[ Resource.MessageKey.exc_invalid_node_name, reader.LocalName ] ); } }