Ejemplo n.º 1
0
 public ColumnSpec SetTotal(TotalOperation totalOperation)
 {
     return(new ColumnSpec(this)
     {
         Total = totalOperation
     });
 }
Ejemplo n.º 2
0
        // ReSharper disable NonLocalizedString
        public static ColumnSpec ReadXml(XmlReader reader)
        {
            TotalOperation total    = TotalOperation.GroupBy;
            string         strTotal = reader.GetAttribute("total");

            if (strTotal != null)
            {
                total = (TotalOperation)Enum.Parse(typeof(TotalOperation), strTotal);
            }
            var columnSpec = new ColumnSpec
            {
                Name    = reader.GetAttribute("name"),
                Caption = reader.GetAttribute("caption"),
                Format  = reader.GetAttribute("format"),
                Hidden  = "true" == reader.GetAttribute("hidden"),
                Total   = total,
            };
            string sortIndex = reader.GetAttribute("sortindex");

            if (sortIndex != null)
            {
                columnSpec.SortIndex = Convert.ToInt32(sortIndex);
            }
            string sortDirection = reader.GetAttribute("sortdirection");

            if (sortDirection != null)
            {
                columnSpec.SortDirection = (ListSortDirection)Enum.Parse(typeof(ListSortDirection), sortDirection);
            }


            bool empty = reader.IsEmptyElement;

            reader.ReadElementString("column");
            if (!empty)
            {
                reader.ReadEndElement();
            }
            return(columnSpec);
        }