Пример #1
0
        public DBSettings Copy()
        {
            DBSettings result = new DBSettings();

            result.Connection = this.Connection;
            return(result);
        }
Пример #2
0
        public static DBSettings Load(DBSettings defaultSettings = null)
        {
            DBSettings settings = defaultSettings;

            if (ExistFileSettings())
            {
                BinaryFormatter formatter = new BinaryFormatter();
                using (FileStream fs = new FileStream(Path.Combine(Environment.CurrentDirectory, "dbsettings.cpf"), FileMode.Open)) {
                    settings = (DBSettings)formatter.Deserialize(fs);
                }
            }

            return(settings);
        }