Ejemplo n.º 1
0
        public static string GetXml(this IDashboardDefinition template, FilterEnabled filterEnabled, IObjectSpace objectSpace)
        {
            var dashBoard = template.CreateDashBoard(objectSpace, filterEnabled);

            using (var memoryStream = new MemoryStream()) {
                dashBoard.SaveToXml(memoryStream);
                memoryStream.Position = 0;
                var document           = XDocument.Load(memoryStream);
                var dataSourceAdapters = GetDataSources(dashBoard, filterEnabled, template, objectSpace);
                foreach (var dataSourceAdapter in dataSourceAdapters)
                {
                    if (document.Root != null)
                    {
                        DataSourceAdapter adapter = dataSourceAdapter;
                        var datasources           = document.Root.Descendants("DataSource").Where(element => element.Attribute("Name").Value == adapter.DataSource.Name && !element.Descendants("Filter").Any());
                        foreach (var datasource in datasources)
                        {
                            datasource.Add(new XElement("Filter", dataSourceAdapter.DataSource.Filter));
                        }
                    }
                }
                return(document.ToString());
            }
        }
Ejemplo n.º 2
0
 public void LoadTemplate(IDashboardDefinition dashboardDefinition)
 {
     _template             = dashboardDefinition;
     Designer.Dashboard    = _template.CreateDashBoard(FilterEnabled.DesignTime);
     _editHistory.Changed += _EditHistory_Changed;
 }
Ejemplo n.º 3
0
 public void LoadTemplate(IDashboardDefinition DashboardDefinition) {
     _template = DashboardDefinition;
     Designer.Dashboard = _template.CreateDashBoard(ObjectSpace, true);
     _editHistory.Changed += _EditHistory_Changed;
 }
Ejemplo n.º 4
0
 public void LoadTemplate(IDashboardDefinition dashboardDefinition)
 {
     _template             = dashboardDefinition;
     Designer.Dashboard    = _template.CreateDashBoard(ObjectSpace, true);
     _editHistory.Changed += _EditHistory_Changed;
 }
Ejemplo n.º 5
0
 public void LoadTemplate(IDashboardDefinition dashboardDefinition) {
     _template = dashboardDefinition;
     Designer.Dashboard = _template.CreateDashBoard(ObjectSpace, FilterEnabled.DesignTime);
     _editHistory.Changed += _EditHistory_Changed;
 }