internal static UIElement CreateReportObject(XElement xmlObject, bool isDesignMode)
        {
            string objectTypeName = xmlObject.Attribute("ObjectType").Value;

            switch (objectTypeName)
            {
            case "ReportDataObject":

                ReportDataObject column = new ReportDataObject();

                column.IsDesignMode = isDesignMode;

                column.ItemXml = xmlObject;

                return(column as UIElement);

            case "ReportLabel":

                ReportLabel lbl = new ReportLabel();

                lbl.IsDesignMode = isDesignMode;

                lbl.ItemXml = xmlObject;

                return(lbl as UIElement);

            case "ReportBorder":

                ReportBorder border = new ReportBorder();

                border.IsDesignMode = isDesignMode;

                border.ItemXml = xmlObject;

                return(border as UIElement);

            case "CurrentDate":

                CurrentDate date = new CurrentDate();

                date.IsDesignMode = isDesignMode;

                date.ItemXml = xmlObject;

                return(date as UIElement);

            case "ReportImage":

                ReportImage image = new ReportImage();

                image.ItemXml = xmlObject;

                return(image as UIElement);

            case "ReportHorizontalLine":

                ReportHorizontalLine horizontalLine = new ReportHorizontalLine();

                horizontalLine.ItemXml = xmlObject;

                return(horizontalLine as UIElement);

            case "ReportVerticalLine":

                ReportVerticalLine verticalLine = new ReportVerticalLine();

                verticalLine.ItemXml = xmlObject;

                return(verticalLine as UIElement);

            case "ReportPageBreak":

                ReportPageBreak pageBreak = new ReportPageBreak();

                pageBreak.ItemXml = xmlObject;

                return(pageBreak as UIElement);

            case "ReportSum":

                ReportSum reportSum = new ReportSum();

                reportSum.ItemXml = xmlObject;

                return(reportSum as UIElement);

            default:

                return(new ReportLabel() as UIElement);
            }
        }
Пример #2
0
 public static Invocation ToInvocation(this ReportLabel reportLabel) => new Invocation("New-CBreezeReportLabel", reportLabel.ToParameters());