Interaction logic for ConnectDialog.xaml
Inheritance: System.Windows.Window
Example #1
0
        bool AddFederation(DirectoryInfo dirInfo)
        {
            FederationInfo info = new FederationInfo();

            if (dirInfo != null)
            {
                info.SystemDbsPath = dirInfo.FullName;
            }
            ConnectionDialog popup  = new ConnectionDialog(info);
            bool?            result = popup.ShowDialog();

            if (result != null && result.Value)
            {
                if (info.HostName == null || info.HostName.Length == 0)
                {
                    info.HostName = SessionBase.LocalHost;
                }
                SessionBase session = m_viewModel.ActiveSession;
                if (session.InTransaction)
                {
                    session.Commit();
                }
                session.BeginUpdate();
                session.Persist(info);
                session.Commit();
                m_viewModel      = new AllFederationsViewModel();
                base.DataContext = m_viewModel;
                return(true);
            }
            return(false);
        }
 private void AddMenuItem_Click(object sender, RoutedEventArgs e)
 {
   FederationInfo info = new FederationInfo();
   ConnectionDialog popup = new ConnectionDialog(info);
   bool? result = popup.ShowDialog();
   if (result != null && result.Value)
   {
     SessionBase session = m_viewModel.ActiveSession;
     session.BeginUpdate();
     session.Persist(info);
     session.Commit();
     m_viewModel = new AllFederationsViewModel();
     base.DataContext = m_viewModel;
   }
 }
        private void AddMenuItem_Click(object sender, RoutedEventArgs e)
        {
            FederationInfo   info   = new FederationInfo();
            ConnectionDialog popup  = new ConnectionDialog(info);
            bool?            result = popup.ShowDialog();

            if (result != null && result.Value)
            {
                SessionBase session = m_viewModel.ActiveSession;
                session.BeginUpdate();
                session.Persist(info);
                session.Commit();
                m_viewModel      = new AllFederationsViewModel();
                base.DataContext = m_viewModel;
            }
        }
Example #4
0
 bool AddFederation(DirectoryInfo dirInfo)
 {
   FederationInfo info = new FederationInfo();
   if (dirInfo != null)
     info.SystemDbsPath = dirInfo.FullName;
   ConnectionDialog popup = new ConnectionDialog(info);
   bool? result = popup.ShowDialog();
   if (result != null && result.Value)
   {
     if (info.HostName == null || info.HostName.Length == 0)
       info.HostName = SessionBase.LocalHost;
     SessionBase session = m_viewModel.ActiveSession;
     if (session.InTransaction)
       session.Commit();
     session.BeginUpdate();
     session.Persist(info);
     session.Commit();
     m_viewModel = new AllFederationsViewModel();
     base.DataContext = m_viewModel;
     return true;
   }
   return false;
 }