Exemple #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 AllFederationsSchemaViewModel();
                base.DataContext = m_viewModel;
                return(true);
            }
            return(false);
        }
Exemple #2
0
        public Schema(string dbFilePath)
        {
            InitializeComponent();
            m_viewModel = new AllFederationsSchemaViewModel();
            DirectoryInfo dirInfo = m_viewModel.Initialize(dbFilePath);
            //DataCache.MaximumMemoryUse = 3000000000; // 3 GB, set this to what fits your case
            bool addedFd = false;

            if (dirInfo != null)
            {
                addedFd = AddFederation(dirInfo);
            }
            if (addedFd == false)
            {
                base.DataContext = m_viewModel;
            }
        }