protected override IEnumerable <QueryElement> CreateItems()
        {
            var filterQueryElement = new FilterQueryElement(DataSource, ID, Name, GetIndentation());

            filterQueryElement.Properties.Description = Description;
            yield return(filterQueryElement);
        }
 public static void Write(this FilterQueryElement element, CSideWriter writer)
 {
     WriteDeclaration(element.ID, element.IndentationLevel, "Filter", element.Name, writer);
     element.Properties.Where(p => p.HasValue).Write(PropertiesStyle.Field, writer);
     writer.WriteLine("}");
     writer.Unindent();
     writer.InnerWriter.WriteLine();
 }
Ejemplo n.º 3
0
        public static IEnumerable<ParameterBase> ToParameters(this FilterQueryElement filterQueryElement)
        {
            yield return new SimpleParameter("ID", filterQueryElement.ID);
            yield return new SimpleParameter("Name", filterQueryElement.Name);

            foreach (var parameter in filterQueryElement.AllProperties.WithAValue.SelectMany(p => p.ToParameters()))
            {
                yield return parameter;
            }
        }
Ejemplo n.º 4
0
        protected override IEnumerable <QueryElement> CreateItems()
        {
            var filterQueryElement = new FilterQueryElement(DataSource, ID, Name, GetIndentation());

            filterQueryElement.Properties.CaptionML.Set(CaptionML);
            filterQueryElement.Properties.Description = Description;

            var subObjects = SubObjects?.Invoke().Select(o => o.BaseObject) ?? Enumerable.Empty <object>();

            filterQueryElement.Properties.ColumnFilter.AddRange(subObjects.OfType <TableFilterLine>());

            yield return(filterQueryElement);
        }
Ejemplo n.º 5
0
        public static IEnumerable <ParameterBase> ToParameters(this FilterQueryElement filterQueryElement)
        {
            yield return(new SimpleParameter("ID", filterQueryElement.ID));

            yield return(new SimpleParameter("Name", filterQueryElement.Name));

            foreach (var parameter in filterQueryElement.AllProperties.WithAValue.SelectMany(p => p.ToParameters()))
            {
                yield return(parameter);
            }

            yield return(new ScriptBlockParameter(
                             "SubObjects",
                             filterQueryElement.Properties.ColumnFilter.Select(f => f.ToInvocation())));
        }