Exemplo n.º 1
0
 public static FieldRef GetCamlFieldRef(this XElement xmlNode)
 {
     FieldRef fieldRef = new FieldRef();
     fieldRef.Name = xmlNode.Attribute("Name").Value;
     fieldRef.DisplayName = xmlNode.Attribute("DisplayName") == null ?
         null : xmlNode.Attribute("DisplayName").Value;
     fieldRef.IsHidden = xmlNode.AttributeBoolOrFalse("Hidden");
     fieldRef.IsReadOnly = xmlNode.AttributeBoolOrFalse("ReadOnly");
     fieldRef.IsRequired = xmlNode.AttributeBoolOrFalse("Required");
     return fieldRef;
 }
Exemplo n.º 2
0
 public static Field GetCamlField(this XElement xmlNode)
 {
     Field field = new Field();
     field.Name = xmlNode.Attribute("Name").Value;
     field.IsRequired  = xmlNode.AttributeBoolOrFalse("Required");
     field.IsReadOnly = xmlNode.AttributeBoolOrFalse("ReadOnly");
     field.IsHidden = xmlNode.AttributeBoolOrFalse("Hidden");
     field.FieldType   = xmlNode.Attribute("Type").Value;
     field.DisplayName = xmlNode.Attribute("DisplayName").Value;
     field.IsIndexed = xmlNode.AttributeBoolOrFalse("Indexed");
     field.List = xmlNode.AttributeValueOrDefault("List");
     field.IsPrimaryKey = xmlNode.AttributeBoolOrFalse("PrimaryKey");
     return field;
 }
Exemplo n.º 3
0
        public static ChangeLog GetCamlChangeLog(this XElement xmlNode)
        {
            ChangeLog log = new ChangeLog(
                xmlNode.Elements(xmlNode.GetDefaultNamespace() + "Id").Select(c => c.GetCamlChangeItem())
                );

            log.MoreChanges = xmlNode.AttributeBoolOrFalse("MoreChanges");
            log.NextLastChangeToken = xmlNode.AttributeValueOrDefault("LastChangeToken");

            XElement newListDef = xmlNode.Element(xmlNode.GetDefaultNamespace() + "List");

            if (newListDef != null)
                log.NewListDef = newListDef.GetCamlListDef();
            else
                log.NewListDef = null;

            return log;
        }
Exemplo n.º 4
0
 public static List GetCamlList(this XElement xmlNode)
 {
     List list = new List();
     list.Name = xmlNode.Attribute("Title").Value;
     list.ID   = new Guid(xmlNode.Attribute("ID").Value);
     list.Description = xmlNode.AttributeValueOrDefault("Description");
     list.InternalName = xmlNode.Attribute("Name").Value;
     list.Version = Int32.Parse(xmlNode.Attribute("Version").Value);
     list.IsHidden = xmlNode.AttributeBoolOrFalse("Hidden");
     list.IsOrdered = xmlNode.AttributeBoolOrFalse("Ordered");
     return list;
 }