Ejemplo n.º 1
0
        /// <summary>
        /// Returns a <see cref="string"/> which represents the object instance.
        /// </summary>
        /// <returns>CAML-like string.</returns>
        public override string ToString()
        {
            switch (FieldRef.Type)
            {
            case FieldRefType.Key:
                return($"<FieldRef Name='ID' Ascending='{Ascending.ToString().ToUpper()}' />");

            case FieldRefType.ContentTypeId:
                return($"<FieldRef Name='ContentTypeId' Ascending='{Ascending.ToString().ToUpper()}' />");

            case FieldRefType.KnownMember:
                var memberRef = (MemberRefModel)FieldRef;
                return($"<FieldRef Name='{memberRef.Member.Name}' Ascending='{Ascending.ToString().ToUpper()}' />");
            }
            return($"<InvalidFieldRef Name='' Ascending='{Ascending.ToString().ToUpper()}' />");
        }
Ejemplo n.º 2
0
        public override XmlNode Serialize(XmlNode nodParent)
        {
            XmlNode nodMask = base.Serialize(nodParent);

            nodMask.AppendChild(nodParent.OwnerDocument.CreateElement("DirectionField")).InnerText = DirectionField;

            if (!string.IsNullOrEmpty(LabelField))
            {
                nodMask.AppendChild(nodParent.OwnerDocument.CreateElement("LabelField")).InnerText = LabelField;
            }

            if (!string.IsNullOrEmpty(DistanceField))
            {
                nodMask.AppendChild(nodParent.OwnerDocument.CreateElement("DistanceField")).InnerText = LabelField;
            }

            nodMask.AppendChild(nodParent.OwnerDocument.CreateElement("Ascending")).InnerText = Ascending.ToString();

            return(nodMask);
        }
Ejemplo n.º 3
0
 public String ToString(String separator)
 {
     return(IdFolder.ToString() + separator + Type.ToString() + separator + ItemsOrderBy.ToString() + separator + Ascending.ToString()
            + separator + (String.IsNullOrEmpty(IdentifierPath) ? "": IdentifierPath.ToString()) + separator + Repository.ToString(separator));
 }