/// <summary>
        /// Initializes a new instance of the <see cref="ReadOnlyBrowsingOptionalNodeIndex"/> class.
        /// </summary>
        /// <param name="parentNode">Node containing the indexed optional node.</param>
        /// <param name="propertyName">Property in <paramref name="parentNode"/> corresponding to the indexed optional node.</param>
        public ReadOnlyBrowsingOptionalNodeIndex(INode parentNode, string propertyName)
        {
            Debug.Assert(parentNode != null);
            Debug.Assert(!string.IsNullOrEmpty(propertyName));
            Debug.Assert(NodeTreeHelperOptional.IsOptionalChildNodeProperty(parentNode, propertyName, out Type ChildNodeType));

            Optional = NodeTreeHelperOptional.GetOptionalReference(parentNode, propertyName);
            Debug.Assert(Optional != null);

            PropertyName = propertyName;
        }
示例#2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WriteableInsertionOptionalClearIndex"/> class.
        /// </summary>
        /// <param name="parentNode">Node containing the indexed optional node.</param>
        /// <param name="propertyName">Property in <paramref name="parentNode"/> corresponding to the indexed optional node.</param>
        public WriteableInsertionOptionalClearIndex(INode parentNode, string propertyName)
        {
            Debug.Assert(parentNode != null);
            Debug.Assert(!string.IsNullOrEmpty(propertyName));

            ParentNode   = parentNode;
            PropertyName = propertyName;

            Optional = NodeTreeHelperOptional.GetOptionalReference(parentNode, propertyName);
            Debug.Assert(Optional != null);
        }
示例#3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="WriteableInsertionOptionalClearIndex"/> class.
        /// </summary>
        /// <param name="parentNode">Node containing the indexed optional node.</param>
        /// <param name="propertyName">Property in <paramref name="parentNode"/> corresponding to the indexed optional node.</param>
        public WriteableInsertionOptionalClearIndex(Node parentNode, string propertyName)
        {
            Contract.RequireNotNull(parentNode, out Node ParentNode);
            Contract.RequireNotNull(propertyName, out string PropertyName);
            Debug.Assert(PropertyName.Length > 0);

            this.ParentNode   = ParentNode;
            this.PropertyName = PropertyName;

            Optional = NodeTreeHelperOptional.GetOptionalReference(ParentNode, PropertyName);
            Debug.Assert(Optional != null);
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ReadOnlyBrowsingOptionalNodeIndex"/> class.
        /// </summary>
        /// <param name="parentNode">Node containing the indexed optional node.</param>
        /// <param name="propertyName">Property in <paramref name="parentNode"/> corresponding to the indexed optional node.</param>
        public ReadOnlyBrowsingOptionalNodeIndex(Node parentNode, string propertyName)
        {
            Contract.RequireNotNull(parentNode, out Node ParentNode);
            Contract.RequireNotNull(propertyName, out string PropertyName);
            Debug.Assert(PropertyName.Length > 0);
            Debug.Assert(NodeTreeHelperOptional.IsOptionalChildNodeProperty(ParentNode, PropertyName, out _));

            Optional = NodeTreeHelperOptional.GetOptionalReference(ParentNode, PropertyName);
            Debug.Assert(Optional != null);

            this.PropertyName = PropertyName;
        }