Example #1
0
        private void ViewModel_CloseDialog(object sender, CloseDialogEventArgs e)
        {
            if (!m_closing)
            {
                try
                {
                    m_closing = true;

                    // DAN: Workaround as for some reason even after dialog is closed
                    // The command manager keeps querying the commands in the data model!
                    DataContext = null;

                    // Only set dialog result if this is a modal dialog
                    if (ComponentDispatcher.IsThreadModal)
                    {
                        try
                        {
                            DialogResult = e.DialogResult;
                        }
                        catch (InvalidOperationException)
                        {
                            // Occasional strange behavior when trying to set DialogResult
                            // when the window does not think it is modal?
                        }
                    }

                    // Is this required?
                    Close();
                }
                finally
                {
                    m_closing = false;
                }
            }
        }
        protected virtual void OnCloseDialog(object sender, CloseDialogEventArgs e)
        {
            EventHandler <CloseDialogEventArgs> handler = CloseDialog;

            if (handler != null)
            {
                handler(sender, e);
            }
        }
Example #3
0
        protected override void OnCloseDialog(CloseDialogEventArgs args)
        {
            base.OnCloseDialog(args);
            if (args.DialogResult == true)
            {
                var uris = (from item in m_checkInItems
                            where item.IsChecked
                            select item.Resource.Uri);

                m_sourceControlService.CheckIn(uris, Description);
            }
        }
Example #4
0
 // This is called when the view model requests the close - e.g. if the vm CloseCommand has been executed
 private void ViewModel_CloseDialog(object sender, CloseDialogEventArgs e)
 {
     if (!m_closing)
     {
         try
         {
             m_closing = true;
             m_host.RequestClose(e.DialogResult);
         }
         finally
         {
             m_closing = false;
         }
     }
 }
Example #5
0
        protected override void OnCloseDialog(CloseDialogEventArgs args)
        {
            base.OnCloseDialog(args);
            if (args.DialogResult == true)
            {
                // check out files that are locally modified but not opened
                foreach (var item in m_modified)
                {
                    if (item.IsChecked)
                    {
                        m_sourceControlService.CheckOut(item.Uri);
                    }
                }

                // add files that are missing in the depot
                foreach (var item in m_notInDepot)
                {
                    if (item.IsChecked)
                    {
                        m_sourceControlService.Add(item.Uri);
                    }
                }
            }
        }
Example #6
0
 private void ViewModel_CloseDialog(object sender, CloseDialogEventArgs e)
 {
     DialogResult = e.DialogResult;
     Close();
 }
Example #7
0
 private void HandleDialogClosed(object sender, CloseDialogEventArgs args)
 {
     AmbitionApp.SendMessage(GameMessages.DIALOG_CLOSED, args.DialogID);
     AmbitionApp.SendMessage(AudioMessages.PLAY, CloseDialogSnd);
 }