Beispiel #1
0
 public FilterInfo(FilterSpec filterSpec, ColumnDescriptor columnDescriptor, ColumnDescriptor collectionColumn)
 {
     FilterSpec       = filterSpec;
     ColumnDescriptor = columnDescriptor;
     CollectionColumn = collectionColumn;
     try
     {
         Predicate = MakePredicate();
     }
     catch (Exception e)
     {
         Error = e.Message;
     }
 }
Beispiel #2
0
        // ReSharper disable NonLocalizedString
        public static FilterSpec ReadXml(XmlReader reader)
        {
            var filterSpec = new FilterSpec
            {
                Column    = reader.GetAttribute("column"),
                Predicate = FilterPredicate.ReadXml(reader),
            };
            bool empty = reader.IsEmptyElement;

            reader.ReadElementString("filter");
            if (!empty)
            {
                reader.ReadEndElement();
            }
            return(filterSpec);
        }
Beispiel #3
0
        // ReSharper disable NonLocalizedString
        public static FilterSpec ReadXml(XmlReader reader)
        {
            var filterSpec = new FilterSpec
            {
                Column  = reader.GetAttribute("column"),
                OpName  = reader.GetAttribute("opname"),
                Operand = reader.GetAttribute("operand")
            };
            bool empty = reader.IsEmptyElement;

            reader.ReadElementString("filter");
            if (!empty)
            {
                reader.ReadEndElement();
            }
            return(filterSpec);
        }
Beispiel #4
0
        // ReSharper disable LocalizableElement
        public static ViewSpec ReadXml(XmlReader reader)
        {
            var viewSpec = new ViewSpec
            {
                Name        = reader.GetAttribute("name"),
                RowSource   = reader.GetAttribute("rowsource"),
                SublistName = reader.GetAttribute("sublist"),
                UiMode      = reader.GetAttribute("uimode") ?? string.Empty
            };
            var columns = new List <ColumnSpec>();
            var filters = new List <FilterSpec>();

            if (reader.IsEmptyElement)
            {
                reader.ReadElementString("view");
                return(viewSpec);
            }
            reader.Read();
            while (true)
            {
                if (reader.IsStartElement("column"))
                {
                    columns.Add(ColumnSpec.ReadXml(reader));
                }
                else if (reader.IsStartElement("filter"))
                {
                    filters.Add(FilterSpec.ReadXml(reader));
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    reader.ReadEndElement();
                    break;
                }
                else
                {
                    reader.Skip();
                }
            }
            viewSpec.Columns = ImmutableList.ValueOf(columns);
            viewSpec.Filters = ImmutableList.ValueOf(filters);
            return(viewSpec);
        }
Beispiel #5
0
        // ReSharper disable NonLocalizedString
        public static ViewSpec ReadXml(XmlReader reader)
        {
            var viewSpec = new ViewSpec
            {
                Name        = reader.GetAttribute("name"),
                RowSource   = reader.GetAttribute("rowsource"),
                SublistName = reader.GetAttribute("sublist")
            };
            var columns = new List <ColumnSpec>();
            var filters = new List <FilterSpec>();

            if (reader.IsEmptyElement)
            {
                reader.ReadElementString("view");
                return(viewSpec);
            }
            reader.Read();
            while (true)
            {
                if (reader.IsStartElement("column"))
                {
                    columns.Add(ColumnSpec.ReadXml(reader));
                }
                else if (reader.IsStartElement("filter"))
                {
                    filters.Add(FilterSpec.ReadXml(reader));
                }
                else if (reader.NodeType == XmlNodeType.EndElement)
                {
                    reader.ReadEndElement();
                    break;
                }
                else
                {
                    reader.Read();
                }
            }
            viewSpec.Columns = Array.AsReadOnly(columns.ToArray());
            viewSpec.Filters = Array.AsReadOnly(filters.ToArray());
            return(viewSpec);
        }
Beispiel #6
0
 private FilterSpec(FilterSpec that)
 {
     Column    = that.Column;
     Predicate = that.Predicate;
 }
Beispiel #7
0
 public ViewSpec()
 {
     Columns = new ColumnSpec[0];
     Filters = new FilterSpec[0];
 }
Beispiel #8
0
 public FilterSpec(FilterSpec that)
 {
     Column  = that.Column;
     OpName  = that.OpName;
     Operand = that.Operand;
 }