/// <summary> /// Gets the source attribute collection. /// </summary> /// <param name="xmlData"> /// The XML data. /// </param> /// <returns> /// </returns> private OCSrcAttributeModelCollection GetSrcAttributeCollection(XElement xmlData) { OCSrcAttributeModelCollection t = new OCSrcAttributeModelCollection(); var theERElement = from oRElementEl in xmlData.Elements(ns + "srcattribute") select oRElementEl; if (theERElement.Any()) { // load event object references foreach (XElement theLoadORElement in theERElement) { SrcAttributeModel tt = new SrcAttributeModel { GPriv = SetPrivateObject(GetAttribute(theLoadORElement.Attribute("priv"))), GType = GetAttribute(theLoadORElement.Attribute("type")), GValue = GetAttribute(theLoadORElement.Attribute("value")), }; t.Add(tt); } } // Return sorted by the default text t.Sort(T => T.DeRef.GetDefaultText); return(t); }
/// <summary> /// Gets the source attribute collection. /// </summary> /// <param name="xmlData"> /// The XML data. /// </param> /// <returns> /// </returns> private HLinkOCSrcAttributeCollection GetSrcAttributeCollection(XElement xmlData) { HLinkOCSrcAttributeCollection t = new HLinkOCSrcAttributeCollection { Title = "Source Attribute Collection" }; var theERElement = from oRElementEl in xmlData.Elements(ns + "srcattribute") select oRElementEl; if (theERElement.Any()) { // load event object references foreach (XElement theLoadORElement in theERElement) { SrcAttributeModel tt = new SrcAttributeModel { Priv = GetPrivateObject(theLoadORElement), GType = GetAttribute(theLoadORElement.Attribute("type")), GValue = GetAttribute(theLoadORElement.Attribute("value")), }; HLinkSrcAttributeModel newHLink = new HLinkSrcAttributeModel() { DeRef = tt, }; t.Add(newHLink); } } // Return sorted by the default text t.Sort(T => T.DeRef.ToString()); return(t); }