예제 #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;
     }
 }
예제 #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);
        }
예제 #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);
        }
예제 #4
0
파일: ColumnSpec.cs 프로젝트: rfellers/pwiz
        // 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);
        }
예제 #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);
        }
예제 #6
0
 private FilterSpec(FilterSpec that)
 {
     Column    = that.Column;
     Predicate = that.Predicate;
 }
예제 #7
0
 public ViewSpec()
 {
     Columns = new ColumnSpec[0];
     Filters = new FilterSpec[0];
 }
예제 #8
0
 public FilterSpec(FilterSpec that)
 {
     Column  = that.Column;
     OpName  = that.OpName;
     Operand = that.Operand;
 }