/// <summary> /// Initializes a new instance of the <see cref="WriteableInsertionPlaceholderNodeIndex"/> class. /// </summary> /// <param name="parentNode">Node containing the replaced node.</param> /// <param name="propertyName">Property in <paramref name="parentNode"/> corresponding to the indexed node.</param> /// <param name="node">The assigned node.</param> public WriteableInsertionPlaceholderNodeIndex(Node parentNode, string propertyName, Node node) { Contract.RequireNotNull(parentNode, out Node ParentNode); Contract.RequireNotNull(propertyName, out string PropertyName); Contract.RequireNotNull(node, out Node Node); Debug.Assert(NodeTreeHelper.IsAssignable(ParentNode, PropertyName, Node)); this.ParentNode = ParentNode; this.PropertyName = PropertyName; this.Node = Node; }
/// <summary> /// Initializes a new instance of the <see cref="WriteableInsertionCollectionNodeIndex"/> class. /// </summary> /// <param name="parentNode">The node in which the insertion operation is taking place.</param> /// <param name="propertyName">The property for the index.</param> /// <param name="node">The inserted node.</param> public WriteableInsertionCollectionNodeIndex(INode parentNode, string propertyName, INode node) { Debug.Assert(parentNode != null); Debug.Assert(!string.IsNullOrEmpty(propertyName)); Debug.Assert(node != null); Debug.Assert(NodeTreeHelper.IsAssignable(parentNode, propertyName, node)); ParentNode = parentNode; PropertyName = propertyName; Node = node; }
/// <summary> /// Initializes a new instance of the <see cref="WriteableInsertionOptionalNodeIndex"/> 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> /// <param name="node">The assigned node.</param> public WriteableInsertionOptionalNodeIndex(INode parentNode, string propertyName, INode node) { Debug.Assert(parentNode != null); Debug.Assert(!string.IsNullOrEmpty(propertyName)); Debug.Assert(node != null); Debug.Assert(NodeTreeHelper.IsAssignable(parentNode, propertyName, node)); ParentNode = parentNode; PropertyName = propertyName; Node = node; Optional = NodeTreeHelperOptional.GetOptionalReference(parentNode, propertyName); Debug.Assert(Optional != null); }
/// <summary> /// Initializes a new instance of the <see cref="WriteableInsertionOptionalNodeIndex"/> 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> /// <param name="node">The assigned node.</param> public WriteableInsertionOptionalNodeIndex(Node parentNode, string propertyName, Node node) { Contract.RequireNotNull(parentNode, out Node ParentNode); Contract.RequireNotNull(propertyName, out string PropertyName); Contract.RequireNotNull(node, out Node Node); Debug.Assert(PropertyName.Length > 0); Debug.Assert(NodeTreeHelper.IsAssignable(ParentNode, PropertyName, Node)); this.ParentNode = ParentNode; this.PropertyName = PropertyName; this.Node = Node; Optional = NodeTreeHelperOptional.GetOptionalReference(ParentNode, PropertyName); Debug.Assert(Optional != null); }