/// <summary> /// Returns true if <paramref name="other"/> does not contain any of the /// items in this list /// </summary> public BL ExcludesAll(IColl <T> other) { bool includesOne = false; foreach (var item in this) { includesOne |= other.Contains(item); } return(!includesOne); }
/// <summary> /// Returns true if <paramref name="other"/> contains all the items /// in this list /// </summary> public BL IncludesAll(IColl <T> other) { bool includesAll = true; foreach (var item in this) { includesAll &= other.Contains(item); } return(includesAll); }
/// <summary> /// Graph <paramref name="o"/> onto <paramref name="s"/> storing /// details in <paramref name="result"/> /// </summary> public void Graph(System.Xml.XmlWriter s, object o, DatatypeR2FormatterGraphResult result) { // Cast to strongly typed data IColl collInstance = o as IColl; IAny anyInstance = o as IAny; // Base formatter ANYFormatter baseFormatter = new ANYFormatter(); baseFormatter.Host = this.Host; baseFormatter.Graph(s, o, result); // Graphing a COLL is easy, we just iterate over the items if (anyInstance.NullFlavor == null) { foreach (var itm in collInstance) { // Start the item tag s.WriteStartElement("item", "urn:hl7-org:v3"); // Output an XSI type if the type does not match the generic parameter if (itm.GetType() != GenericArguments[0]) { var xsiName = DatatypeR2Formatter.CreateXSITypeName(itm.GetType()); s.WriteAttributeString("xsi", "type", DatatypeR2Formatter.NS_XSI, xsiName); } // Format the item var hostResult = this.Host.Graph(s, itm as IGraphable); result.Code = hostResult.Code; result.AddResultDetail(hostResult.Details); // End of item tag s.WriteEndElement(); } } }
/// <summary> /// Returns a new instance of <see cref="T:BL"/> indicating whether /// the SLIST excludes all the items from <paramref name="other"/> /// </summary> /// <param name="other">The other collection to detect exclusion</param> public BL ExcludesAll(IColl <INT> other) { return(this.m_digits.ExcludesAll(other)); }