mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Renamed several database related properties to be more generic ("sql" -> "database")
This commit is contained in:
@@ -487,13 +487,13 @@ namespace mRemoteNG.App
|
||||
ConnectionTree.ResetTree();
|
||||
|
||||
connectionsLoader.RootTreeNode = Windows.treeForm.tvConnections.Nodes[0];
|
||||
connectionsLoader.UseSql = Settings.Default.UseSQLServer;
|
||||
connectionsLoader.SqlHost = Settings.Default.SQLHost;
|
||||
connectionsLoader.SqlDatabaseName = Settings.Default.SQLDatabaseName;
|
||||
connectionsLoader.SqlUsername = Settings.Default.SQLUser;
|
||||
connectionsLoader.UseDatabase = Settings.Default.UseSQLServer;
|
||||
connectionsLoader.DatabaseHost = Settings.Default.SQLHost;
|
||||
connectionsLoader.DatabaseName = Settings.Default.SQLDatabaseName;
|
||||
connectionsLoader.DatabaseUsername = Settings.Default.SQLUser;
|
||||
var cryptographyProvider = new LegacyRijndaelCryptographyProvider();
|
||||
connectionsLoader.SqlPassword = cryptographyProvider.Decrypt(Convert.ToString(Settings.Default.SQLPass), GeneralAppInfo.EncryptionKey);
|
||||
connectionsLoader.SqlUpdate = update;
|
||||
connectionsLoader.DatabasePassword = cryptographyProvider.Decrypt(Convert.ToString(Settings.Default.SQLPass), GeneralAppInfo.EncryptionKey);
|
||||
connectionsLoader.DatabaseUpdate = update;
|
||||
connectionsLoader.LoadConnections(false);
|
||||
|
||||
if (Settings.Default.UseSQLServer)
|
||||
|
||||
@@ -8,12 +8,12 @@ namespace mRemoteNG.Config.Connections
|
||||
{
|
||||
public class ConnectionsLoader
|
||||
{
|
||||
public bool UseSql { get; set; }
|
||||
public string SqlHost { get; set; }
|
||||
public string SqlDatabaseName { get; set; }
|
||||
public string SqlUsername { get; set; }
|
||||
public string SqlPassword { get; set; }
|
||||
public bool SqlUpdate { get; set; }
|
||||
public bool UseDatabase { get; set; }
|
||||
public string DatabaseHost { get; set; }
|
||||
public string DatabaseName { get; set; }
|
||||
public string DatabaseUsername { get; set; }
|
||||
public string DatabasePassword { get; set; }
|
||||
public bool DatabaseUpdate { get; set; }
|
||||
public string PreviousSelected { get; set; }
|
||||
public string ConnectionFileName { get; set; }
|
||||
public TreeNode RootTreeNode { get; set; }
|
||||
@@ -25,7 +25,7 @@ namespace mRemoteNG.Config.Connections
|
||||
|
||||
public void LoadConnections(bool import)
|
||||
{
|
||||
if (UseSql)
|
||||
if (UseDatabase)
|
||||
{
|
||||
var sqlConnectionsLoader = new SqlConnectionsLoader()
|
||||
{
|
||||
@@ -35,11 +35,11 @@ namespace mRemoteNG.Config.Connections
|
||||
PreviousContainerList = PreviousContainerList,
|
||||
PreviousSelected = PreviousSelected,
|
||||
RootTreeNode = RootTreeNode,
|
||||
SqlDatabaseName = SqlDatabaseName,
|
||||
SqlHost = SqlHost,
|
||||
SqlPassword = SqlPassword,
|
||||
SqlUpdate = SqlUpdate,
|
||||
SqlUsername = SqlUsername
|
||||
DatabaseName = DatabaseName,
|
||||
DatabaseHost = DatabaseHost,
|
||||
DatabasePassword = DatabasePassword,
|
||||
DatabaseUpdate = DatabaseUpdate,
|
||||
DatabaseUsername = DatabaseUsername
|
||||
};
|
||||
sqlConnectionsLoader.LoadFromSql();
|
||||
}
|
||||
@@ -51,12 +51,12 @@ namespace mRemoteNG.Config.Connections
|
||||
ConnectionList = ConnectionList,
|
||||
ContainerList = ContainerList,
|
||||
RootTreeNode = RootTreeNode,
|
||||
UseSql = UseSql
|
||||
UseSql = UseDatabase
|
||||
};
|
||||
xmlConnectionsLoader.LoadFromXml(import);
|
||||
}
|
||||
|
||||
frmMain.Default.AreWeUsingSqlServerForSavingConnections = UseSql;
|
||||
frmMain.Default.AreWeUsingSqlServerForSavingConnections = UseDatabase;
|
||||
frmMain.Default.ConnectionsFileName = ConnectionFileName;
|
||||
|
||||
if (!import)
|
||||
|
||||
@@ -33,11 +33,11 @@ namespace mRemoteNG.Config.Connections
|
||||
private SecureString _pW = GeneralAppInfo.EncryptionKey;
|
||||
|
||||
|
||||
public string SqlHost { get; set; }
|
||||
public string SqlDatabaseName { get; set; }
|
||||
public string SqlUsername { get; set; }
|
||||
public string SqlPassword { get; set; }
|
||||
public bool SqlUpdate { get; set; }
|
||||
public string DatabaseHost { get; set; }
|
||||
public string DatabaseName { get; set; }
|
||||
public string DatabaseUsername { get; set; }
|
||||
public string DatabasePassword { get; set; }
|
||||
public bool DatabaseUpdate { get; set; }
|
||||
public string PreviousSelected { get; set; }
|
||||
public TreeNode RootTreeNode { get; set; }
|
||||
public ConnectionList ConnectionList { get; set; }
|
||||
@@ -60,7 +60,7 @@ namespace mRemoteNG.Config.Connections
|
||||
try
|
||||
{
|
||||
Runtime.IsConnectionsFileLoaded = false;
|
||||
_sqlConnection = !string.IsNullOrEmpty(SqlUsername) ? new SqlConnection("Data Source=" + SqlHost + ";Initial Catalog=" + SqlDatabaseName + ";User Id=" + SqlUsername + ";Password=" + SqlPassword) : new SqlConnection("Data Source=" + SqlHost + ";Initial Catalog=" + SqlDatabaseName + ";Integrated Security=True");
|
||||
_sqlConnection = !string.IsNullOrEmpty(DatabaseUsername) ? new SqlConnection("Data Source=" + DatabaseHost + ";Initial Catalog=" + DatabaseName + ";User Id=" + DatabaseUsername + ";Password=" + DatabasePassword) : new SqlConnection("Data Source=" + DatabaseHost + ";Initial Catalog=" + DatabaseName + ";Integrated Security=True");
|
||||
|
||||
_sqlConnection.Open();
|
||||
_sqlQuery = new SqlCommand("SELECT * FROM tblRoot", _sqlConnection);
|
||||
@@ -179,7 +179,7 @@ namespace mRemoteNG.Config.Connections
|
||||
ConnectionList.Add(conI);
|
||||
tNode.Tag = conI;
|
||||
|
||||
if (SqlUpdate)
|
||||
if (DatabaseUpdate)
|
||||
{
|
||||
var prevCon = PreviousConnectionList.FindByConstantID(conI.ConstantID);
|
||||
if (prevCon != null)
|
||||
@@ -230,7 +230,7 @@ namespace mRemoteNG.Config.Connections
|
||||
conI.IsContainer = true;
|
||||
contI.ConnectionInfo = conI;
|
||||
|
||||
if (SqlUpdate)
|
||||
if (DatabaseUpdate)
|
||||
{
|
||||
var prevCont = PreviousContainerList.FindByConstantID(conI.ConstantID);
|
||||
if (prevCont != null)
|
||||
@@ -444,7 +444,7 @@ namespace mRemoteNG.Config.Connections
|
||||
connectionInfo.Inheritance.AutomaticResize = Convert.ToBoolean(_sqlDataReader["InheritAutomaticResize"]);
|
||||
}
|
||||
|
||||
if (SqlUpdate)
|
||||
if (DatabaseUpdate)
|
||||
connectionInfo.PleaseConnect = Convert.ToBoolean(_sqlDataReader["Connected"]);
|
||||
|
||||
return connectionInfo;
|
||||
|
||||
Reference in New Issue
Block a user