Пример #1
0
        public void SaveCurrentView()
        {
            if (OwnerStudio.SurfaceManager.ActiveDesignSurface == null)
            {
                return;
            }

            ABCView view = (ABCView)(((HostSurface)OwnerStudio.SurfaceManager.ActiveDesignSurface).DesignerHost.RootComponent);

            view.Save();
        }
Пример #2
0
        public void CloseSurface(HostSurface surface)
        {
            if (surface == null)
            {
                return;
            }

            DevExpress.XtraTab.XtraTabPage currentTab = GetTabPageFromHostSurface(surface);
            if (currentTab == null)
            {
                return;
            }

            if (surface.UndoEngine.CanUndo)
            {
                ABCView view = (ABCView)surface.DesignerHost.RootComponent;
                if (view != null)
                {
                    DialogResult dlgResult = ABCHelper.ABCMessageBox.Show(String.Format(@"Do you want to save '{0}' View   ?", view.Name), "Message", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
                    if (dlgResult == DialogResult.Cancel)
                    {
                        return;
                    }

                    if (dlgResult == DialogResult.Yes)
                    {
                        view.Save();
                    }
                }
            }

            OwnerStudio.SurfaceManager.CloseSurface(surface);

            OwnerStudio.TabViewControl.TabPages.Remove(currentTab);
            OwnerStudio.PropertyGrid.SelectedObject = null;
        }