Esempio n. 1
0
        public void ShowCloseDialog(Action closeTab)
        {
            if ((CMS.EffectivePrivileges.AdminTab.CanModify || CMS.EffectivePrivileges.ControlTab.CanModify) && RequiresSave)
            {
                var saveDialog = new ConfirmSaveDialog(Parent);
                saveDialog.Show();

                saveDialog.Closed +=
                    (s1, e1) =>
                    {
                        if (saveDialog.PopupDialogResult == PopupDialogResult.Yes)
                        {
                            mViewModel.Save(saved =>
                            {
                                if (saved)
                                {
                                    closeTab();
                                }
                            });
                        }

                        if (saveDialog.PopupDialogResult == PopupDialogResult.No)
                        {
                            closeTab();
                        }
                    };
            }
            else
            {
                closeTab();
            }
        }
Esempio n. 2
0
        public void ShowCloseDialog(Action closeTab)
        {
            if (mDocument!=null && !mDocument.IsActive)
            {
                UnsubscribePrismEvents();
                closeTab();
                return; //bye bye - not allowed to save.
            }

            if ((CMS.EffectivePrivileges.AdminTab.CanModify || CMS.EffectivePrivileges.DocumentTab.CanModify) && RequiresSave)
            {

                ConfirmSaveDialog saveDialog = new ConfirmSaveDialog(this.Parent);
                saveDialog.Show();

                saveDialog.Closed +=
                    (s1, e1) =>
                    {
                        if (saveDialog.PopupDialogResult == PopupDialogResult.Yes)
                        {
                            Save((saved) =>
                                     {
                                         if (saved)
                                         {
                                             UnsubscribePrismEvents();
                                             closeTab();
                                         }
                                     });
                        }

                        if (saveDialog.PopupDialogResult == PopupDialogResult.No)
                        {
                            UnsubscribePrismEvents();
                            closeTab();
                        }
                    };
            }
            else
            {
                UnsubscribePrismEvents();
                closeTab();
            }
        }
Esempio n. 3
0
        public void ShowCloseDialog(Action closeTab)
        {
            if ((CMS.EffectivePrivileges.AdminTab.CanModify || CMS.EffectivePrivileges.InstrumentTab.CanModify) && RequiresSave)
            {
                var saveDialog = new ConfirmSaveDialog(Parent);
                saveDialog.Show();

                saveDialog.Closed +=
                    (s1, e1) =>
                    {
                        if (saveDialog.PopupDialogResult == PopupDialogResult.Yes)
                        {
                            Save(saved =>
                            {
                                if (saved)
                                {
                                    UnsubscribePrismEvents();
                                    closeTab();
                                }
                            });
                        }

                        if (saveDialog.PopupDialogResult == PopupDialogResult.No)
                        {
                            UnsubscribePrismEvents();
                            closeTab();
                        }
                    };
            }
            else
            {
                UnsubscribePrismEvents();
                closeTab();
            }
        }