예제 #1
0
        public virtual NonRecursiveElement ToNonRecursiveElement(
            ImmutableObjectGraph.Optional <System.String> name  = default(ImmutableObjectGraph.Optional <System.String>),
            ImmutableObjectGraph.Optional <System.String> value = default(ImmutableObjectGraph.Optional <System.String>))
        {
            NonRecursiveElement that = this as NonRecursiveElement;

            if (that != null && this.GetType().IsEquivalentTo(typeof(NonRecursiveElement)))
            {
                if ((!name.IsDefined || name.Value == that.Name) &&
                    (!value.IsDefined || value.Value == that.Value))
                {
                    return(that);
                }
            }

            return(NonRecursiveElement.CreateWithIdentity(
                       identity: this.Identity,
                       name: name,
                       value: value));
        }
예제 #2
0
 /// <summary>Removes the specified element from the Metadata collection.</summary>
 public ContainerOfNonRecursiveCollection RemoveMetadata(NonRecursiveElement value)
 {
     return(this.With(metadata: this.Metadata.Remove(value)));
 }