Skip to content

Commit

Permalink
Merge pull request #80 from igitur/move-default-settings-to-sqlite-file
Browse files Browse the repository at this point in the history
Changes to stored settings / projects
  • Loading branch information
igitur committed Apr 9, 2018
2 parents 0a6904a + 673f8a5 commit c3b66e0
Show file tree
Hide file tree
Showing 17 changed files with 738 additions and 712 deletions.
16 changes: 8 additions & 8 deletions OpenDBDiff.Schema.SQLServer2005/Front/SQLServerProjectHandler.cs
Expand Up @@ -20,11 +20,11 @@ public IFront CreateDestinationSelector()
{
this.DestinationControl = new SqlServerConnectFront
{
ServerName = Properties.Settings.Default.SQLServerNameDestination,
UseWindowsAuthentication = Properties.Settings.Default.SQLServerUseWindowsAuthenticationDestination,
UserName = Properties.Settings.Default.SQLServerUserDestination,
ServerName = "(local)",
UseWindowsAuthentication = true,
UserName = "sa",
Password = "",
DatabaseName = Properties.Settings.Default.SQLServerDatabaseDestination
DatabaseName = ""
};

this.DestinationControl.Location = new Point(1, 1);
Expand All @@ -40,11 +40,11 @@ public IFront CreateSourceSelector()
{
this.SourceControl = new SqlServerConnectFront
{
ServerName = Properties.Settings.Default.SQLServerNameOrigin,
UseWindowsAuthentication = Properties.Settings.Default.SQLServerUseWindowsAuthenticationOrigin,
UserName = Properties.Settings.Default.SQLServerUserOrigin,
ServerName = "(local)",
UseWindowsAuthentication = true,
UserName = "sa",
Password = "",
DatabaseName = Properties.Settings.Default.SQLServerDatabaseOrigin
DatabaseName = ""
};

SourceControl.Location = new Point(1, 1);
Expand Down
35 changes: 14 additions & 21 deletions OpenDBDiff.Schema.SQLServer2005/Front/SqlServerConnectFront.cs
Expand Up @@ -148,30 +148,23 @@ public string ConnectionString
}
set
{
if (!String.IsNullOrEmpty(value))
if (!String.IsNullOrWhiteSpace(value))
{
string[] items = value.Split(';');
for (int j = 0; j < items.Length; j++)
var builder = new SqlConnectionStringBuilder(value);

ServerName = builder.DataSource;
UseWindowsAuthentication = builder.IntegratedSecurity;
if (UseWindowsAuthentication)
{
string[] item = items[j].Split('=');
if (item[0].Equals("User Id", StringComparison.InvariantCultureIgnoreCase))
{
UserName = item[1];
cboAuthentication.SelectedIndex = 1;
}
if (item[0].Equals("Password", StringComparison.InvariantCultureIgnoreCase))
Password = item[1];
if (item[0].Equals("Data Source", StringComparison.InvariantCultureIgnoreCase))
ServerName = item[1];
if (item[0].Equals("Initial Catalog", StringComparison.InvariantCultureIgnoreCase))
DatabaseName = item[1];
if (item[0].Equals("Integrated Security", StringComparison.InvariantCultureIgnoreCase))
{
cboAuthentication.SelectedIndex = 0;
UserName = "";
Password = "";
}
UserName = "";
Password = "";
}
else
{
UserName = builder.UserID;
Password = builder.Password;
}
DatabaseName = builder.InitialCatalog;
}
else
{
Expand Down
11 changes: 0 additions & 11 deletions OpenDBDiff.Schema.SQLServer2005/OpenDBDiff.Schema.SQLServer.csproj
Expand Up @@ -97,12 +97,6 @@
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
<DependentUpon>Settings.settings</DependentUpon>
</Compile>
<Compile Include="Settings.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\OpenDBDiff.Front\OpenDBDiff.Front.csproj">
Expand All @@ -122,12 +116,7 @@
<None Include="..\.editorconfig">
<Link>.editorconfig</Link>
</None>
<None Include="app.config" />
<None Include="OpenDBDiff.Schema.SQLServer.snk" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="Front\AddItem.resx">
Expand Down
146 changes: 0 additions & 146 deletions OpenDBDiff.Schema.SQLServer2005/Properties/Settings.Designer.cs

This file was deleted.

36 changes: 0 additions & 36 deletions OpenDBDiff.Schema.SQLServer2005/Properties/Settings.settings

This file was deleted.

36 changes: 0 additions & 36 deletions OpenDBDiff.Schema.SQLServer2005/Settings.cs

This file was deleted.

43 changes: 0 additions & 43 deletions OpenDBDiff.Schema.SQLServer2005/app.config

This file was deleted.

0 comments on commit c3b66e0

Please sign in to comment.