Пример #1
0
        /// <summary>
        /// Creates a new instance of the evaluaion context.
        /// </summary>
        /// <param name="engine">The engine instance.</param>
        /// <param name="policyDocument">The policy document instance.</param>
        /// <param name="contextDocument">The context document instance.</param>
        public EvaluationContext(EvaluationEngine engine, PolicyDocument policyDocument, ContextDocument contextDocument)
            : this()
        {
            var attributes = new AttributeReadWriteCollection();
            foreach (AttributeElementReadWrite attribute in contextDocument.Request.Resources[0].Attributes)
            {
                attributes.Add(new AttributeElementReadWrite(attribute));
            }

            ResourceContentElement resourceContent = null;
            if (contextDocument.Request.Resources[0].ResourceContent != null)
            {
                resourceContent = new ResourceContentElement(
                        contextDocument.Request.Resources[0].ResourceContent.XmlDocument,
                        contextDocument.Request.Resources[0].ResourceContent.SchemaVersion);
            }

            _engine = engine;
            _policyDocument = policyDocument;
            _contextDocument = contextDocument;
            CurrentResource = new ResourceElementReadWrite(
                resourceContent,
                contextDocument.Request.Resources[0].ResourceScopeValue,
                attributes,
                contextDocument.Request.Resources[0].SchemaVersion);
        }
Пример #2
0
 /// <summary>
 /// Adds an object to the end of the CollectionBase.
 /// </summary>
 /// <param name="value">The Object to be added to the end of the CollectionBase. </param>
 /// <returns>The CollectionBase index at which the value has been added.</returns>
 public override sealed int Add(ResourceElementReadWrite value)
 {
     if (value == null) throw new ArgumentNullException("value");
     ResourceContentElement resourceContent = null;
     if (value.ResourceContent != null)
     {
         resourceContent = new ResourceContentElement(value.ResourceContent.XmlDocument, value.ResourceContent.SchemaVersion);
     }
     return (List.Add(new ResourceElement(resourceContent, value.ResourceScopeValue, new AttributeCollection(value.Attributes), value.SchemaVersion)));
 }
Пример #3
0
 /// <summary>
 /// Gets the index of the given ResourceElementReadWrite in the collection
 /// </summary>
 /// <param name="resource"></param>
 /// <returns></returns>
 public int GetIndex(ResourceElementReadWrite resource)
 {
     for (int i = 0; i < this.Count; i++)
     {
         if (this.List[i] == resource)
         {
             return(i);
         }
     }
     return(-1);
 }
 /// <summary>
 /// Gets the index of the given ResourceElementReadWrite in the collection
 /// </summary>
 /// <param name="resource"></param>
 /// <returns></returns>
 public int GetIndex(ResourceElementReadWrite resource)
 {
     for (int i = 0; i < this.Count; i++)
     {
         if (this.List[i] == resource)
         {
             return i;
         }
     }
     return -1;
 }
Пример #5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="resource"></param>
        public Resource(con.ResourceElementReadWrite resource)
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            _resource = resource;

            if (_resource.ResourceContent != null)
            {
                txtContent.Text = _resource.ResourceContent.XmlDocument.InnerXml;
            }
        }
Пример #6
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="resource"></param>
        public Resource( con.ResourceElementReadWrite resource )
        {
            // This call is required by the Windows.Forms Form Designer.
            InitializeComponent();

            _resource = resource;

            if( _resource.ResourceContent != null )
            {
                txtContent.Text = _resource.ResourceContent.XmlDocument.InnerXml;
            }
        }
Пример #7
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="resource"></param>
        public Resource(con.ResourceElementReadWrite resource)
        {
            _resource = resource;

            this.Text = "Resource";
            this.SelectedImageIndex = 2;
            this.ImageIndex         = 2;

            foreach (con.AttributeElementReadWrite attr in _resource.Attributes)
            {
                this.Nodes.Add(new Attribute(attr));
            }
        }
Пример #8
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="resource"></param>
        public Resource( con.ResourceElementReadWrite resource )
        {
            _resource = resource;

            this.Text = "Resource";
            this.SelectedImageIndex = 2;
            this.ImageIndex = 2;

            foreach( con.AttributeElementReadWrite attr in _resource.Attributes )
            {
                this.Nodes.Add( new Attribute( attr ) );
            }
        }
Пример #9
0
        /// <summary>
        /// Adds an object to the end of the CollectionBase.
        /// </summary>
        /// <param name="value">The Object to be added to the end of the CollectionBase. </param>
        /// <returns>The CollectionBase index at which the value has been added.</returns>
        public override sealed int Add(ResourceElementReadWrite value)
        {
            if (value == null)
            {
                throw new ArgumentNullException("value");
            }
            ResourceContentElement resourceContent = null;

            if (value.ResourceContent != null)
            {
                resourceContent = new ResourceContentElement(value.ResourceContent.XmlDocument, value.ResourceContent.SchemaVersion);
            }
            return(List.Add(new ResourceElement(resourceContent, value.ResourceScopeValue, new AttributeCollection(value.Attributes), value.SchemaVersion)));
        }
Пример #10
0
 /// <summary>
 /// Adds an object to the end of the CollectionBase.
 /// </summary>
 /// <param name="value">The Object to be added to the end of the CollectionBase. </param>
 /// <returns>The CollectionBase index at which the value has been added.</returns>
 public virtual int Add(ResourceElementReadWrite value)
 {
     return(List.Add(value));
 }
 /// <summary>
 /// Adds an object to the end of the CollectionBase.
 /// </summary>
 /// <param name="value">The Object to be added to the end of the CollectionBase. </param>
 /// <returns>The CollectionBase index at which the value has been added.</returns>
 public virtual int Add(ResourceElementReadWrite value)
 {
     return (List.Add(value));
 }