Пример #1
0
 protected void OnSaveDashboard(DevExpress.DashboardCommon.Dashboard dashboard)
 {
     try
     {
         WaitStart();
         var xaml        = GetDashboardXml(dashboard);
         var xamlManager = IoC.Instance.Resolve <IXamlManager <Dashboard> >();
         var mgr         = IoC.Instance.Resolve <IBaseManager <Dashboard> >();
         Source.SuspendNotifications();
         Source.SuspendValidating();
         Source.SetProperty(Dashboard.DashboardBodyPropertyName, xaml);
         IncrementVersion(Source);
         xamlManager.SetXaml(Source.GetKey().ToString(), xaml ?? string.Empty);
         mgr.Update(Source);
         mgr.ClearCache();
         Source = mgr.Get(Source.GetKey());
         var eo = Source as IEditable;
         if (eo != null)
         {
             eo.AcceptChanges();
         }
     }
     finally
     {
         WaitStop();
         Source.ResumeNotifications();
         Source.ResumeValidating();
     }
 }
Пример #2
0
        private static string GetDashboardXml(DevExpress.DashboardCommon.Dashboard dashboard)
        {
            string xaml;

            using (var stream = new MemoryStream())
                using (var sr = new StreamReader(stream))
                {
                    dashboard.SaveToXml(stream);
                    stream.Seek(0, SeekOrigin.Begin);
                    xaml = sr.ReadToEnd();
                }
            return(xaml);
        }
Пример #3
0
        public static string GetDashboardXml(this DevExpress.DashboardCommon.Dashboard dashboard)
        {
            string xml;

            using (var ms = new MemoryStream()) {
                dashboard.SaveToXml(ms);
                ms.Position = 0;
                using (var sr = new StreamReader(ms)) {
                    xml = sr.ReadToEnd();
                    sr.Close();
                }
                ms.Close();
            }
            return(xml);
        }
Пример #4
0
 protected bool CanSaveDashboard(DevExpress.DashboardCommon.Dashboard dashboard)
 {
     return(true);
 }