Пример #1
0
        protected override IEnumerable <PageControlBase> CreateItems()
        {
            var containerPageControl = new PageControlContainer(ID, 0, ContainerType.GetValueOrDefault(PageControlContainerType.ContentArea));

            containerPageControl.Properties.CaptionML.Set(CaptionML);
            containerPageControl.Properties.Description = Description;
            containerPageControl.Properties.Name        = Name;
            containerPageControl.AutoCaption(AutoCaption);
            yield return(containerPageControl);

            var variables = new List <PSVariable>()
            {
                new PSVariable("ControlIndentation", 1)
            };
            var subObjects = SubObjects?
                             .InvokeWithContext(null, variables)
                             .Select(o => o.BaseObject)
                             .Cast <PageControlBase>()
                             ?? Enumerable.Empty <PageControlBase>();

            foreach (var childControl in subObjects)
            {
                yield return(childControl);
            }
        }
Пример #2
0
        protected override IEnumerable <PageControlBase> CreateItems()
        {
            var groupPageControl = new PageControlGroup(ID, GetIndentation(), GroupType);

            var variables = new List <PSVariable>()
            {
                new PSVariable("ControlIndentation", groupPageControl.IndentationLevel + 1)
            };
            var subObjects = SubObjects?.InvokeWithContext(null, variables).Select(o => o.BaseObject) ?? Enumerable.Empty <object>();

            groupPageControl.Properties.ActionList.AddRange(subObjects.OfType <PageActionBase>());
            groupPageControl.Properties.CaptionML.Set(CaptionML);
            groupPageControl.Properties.Description           = Description;
            groupPageControl.Properties.Name                  = Name;
            groupPageControl.Properties.Editable              = Editable;
            groupPageControl.Properties.Enabled               = Enabled;
            groupPageControl.Properties.FreezeColumnID        = FreezeColumnID;
            groupPageControl.Properties.IndentationColumnName = IndentationColumnName;
            groupPageControl.Properties.IndentationControls.Set(IndentationControls);
            groupPageControl.Properties.InstructionalTextML.Set(InstructionalTextML);
            groupPageControl.Properties.Layout     = Layout;
            groupPageControl.Properties.ShowAsTree = NullableBooleanFromSwitch(nameof(ShowAsTree));
            groupPageControl.Properties.Visible    = Visible;
            groupPageControl.AutoCaption(AutoCaption);

            yield return(groupPageControl);

            foreach (var childControl in subObjects.OfType <PageControlBase>())
            {
                yield return(childControl);
            }
        }
        protected override IEnumerable <QueryElement> CreateItems()
        {
            var indentation = GetIndentation();

            var dataItemQueryElement = new DataItemQueryElement(DataItemTable, ID, Name, indentation);

            dataItemQueryElement.Properties.DataItemLinkType = DataItemLinkType;
            dataItemQueryElement.Properties.Description      = Description;
            dataItemQueryElement.Properties.SQLJoinType      = SQLJoinType;
            yield return(dataItemQueryElement);

            var variables = new List <PSVariable>()
            {
                new PSVariable("ElementIndentation", indentation + 1)
            };

            var subObjects = SubObjects?.InvokeWithContext(null, variables).Select(o => o.BaseObject) ?? Enumerable.Empty <object>();

            dataItemQueryElement.Properties.DataItemTableFilter.AddRange(subObjects.OfType <TableFilterLine>());
            dataItemQueryElement.Properties.DataItemLink.AddRange(subObjects.OfType <QueryDataItemLinkLine>());

            foreach (var childElement in subObjects.OfType <QueryElement>())
            {
                yield return(childElement);
            }
        }
Пример #4
0
        protected override IEnumerable <ReportElement> CreateItems()
        {
            var element = new DataItemReportElement(DataItemTable, ID, IndentationLevel);

            element.Name = Name;

            element.Properties.CalcFields.AddRange(CalcFields);
            element.Properties.DataItemLinkReference   = DataItemLinkReference;
            element.Properties.DataItemTableView.Key   = DataItemTableViewKey;
            element.Properties.DataItemTableView.Order = DataItemTableViewOrder;
            element.Properties.MaxIteration            = MaxIteration;
            element.Properties.OnPreDataItem.Set(OnPreDataItem);
            element.Properties.OnAfterGetRecord.Set(OnAfterGetRecord);
            element.Properties.OnPostDataItem.Set(OnPostDataItem);
            element.Properties.PrintOnlyIfDetail = NullableBooleanFromSwitch(nameof(PrintOnlyIfDetail));
            element.Properties.ReqFilterFields.AddRange(ReqFilterFields);
            element.Properties.ReqFilterHeadingML.Set(ReqFilterHeadingML);
#if NAV2015
            element.Properties.Temporary = NullableBooleanFromSwitch(nameof(Temporary));
#endif

            yield return(element);

            var variables = new List <PSVariable>()
            {
                new PSVariable("ElementIndentation", element.IndentationLevel + 1)
            };
            var subObjects = SubObjects?.InvokeWithContext(null, variables).Select(o => o.BaseObject) ?? Enumerable.Empty <object>();

            element.Properties.DataItemLink.AddRange(subObjects.OfType <ReportDataItemLinkLine>());
            element.Properties.DataItemTableView.TableFilter.AddRange(subObjects.OfType <TableFilterLine>());

            foreach (var subObject in subObjects.OfType <ReportElement>())
            {
                yield return(subObject);
            }
        }