Ejemplo n.º 1
0
 public static DatabaseDefinitions Instance()
 {
     if (instance == null)
     {
         lock (_lock_this)
         {
             instance = new DatabaseDefinitions();
         }
     }
     return(instance);
 }
Ejemplo n.º 2
0
        public void SaveConfig()
        {
            _dbReg.State = eRegState.none;
            var tn = _dbReg.GetNode();

            tn.Text = _dbReg.Alias;
            if (BearbeitenMode == EditStateClass.eBearbeiten.eEdit)
            {
                var drc = DatabaseDefinitions.Instance().Databases.Find(x => x.Position == _dbReg.Position);
            }
            else
            {
                _dbReg.Position = DatabaseDefinitions.Instance().Databases.Count + 1;
                DatabaseDefinitions.Instance().Databases.Add(_dbReg);
                DataToEdit();
            }

            DatabaseDefinitions.Instance().SerializeCurrent("User changed");

            _dbReg.State = Cloned ? eRegState.create : eRegState.update;

            BearbeitenMode = EditStateClass.eBearbeiten.eEdit;
            if (_connectionDataChanged)
            {
                NotifiesClass.Instance().Notify.RaiseInfo($@"Configuration saved for {_dbReg.Alias}->Proc:{Name}->SaveConfig", StaticVariablesClass.DatabaseConfigDataSaved, (object)_dbReg);
                DbExplorerForm.Instance().DbExlorerNotify.Notify.RaiseInfo($@"{_dbReg.Alias}->Proc:{Name}->SaveConfig", StaticVariablesClass.DatabaseConfigDataSaved, (object)_dbReg);
                _connectionDataChanged = false;
            }

            if (_dataChanged)
            {
                tn.Text      = _dbReg.Alias;
                _dataChanged = false;
            }

            if (Cloned)
            {
                Close();
            }
        }