Skip to content

Commit 042d8f0

Browse files
committed
迁移vs2017
1 parent 3ef52b6 commit 042d8f0

9 files changed

+616
-2
lines changed

Backup/AssemblyInitializer.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
using FastReport.Utils;
5+
6+
namespace FastReport.Data
7+
{
8+
public class AssemblyInitializer : AssemblyInitializerBase
9+
{
10+
public AssemblyInitializer()
11+
{
12+
RegisteredObjects.AddConnection(typeof(MySqlDataConnection));
13+
}
14+
}
15+
}

Backup/FastReport.MySQL.csproj

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2+
<PropertyGroup>
3+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
4+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
5+
<ProductVersion>8.0.50727</ProductVersion>
6+
<SchemaVersion>2.0</SchemaVersion>
7+
<ProjectGuid>{447AA2D2-EACA-4819-A605-14FA4921FA3D}</ProjectGuid>
8+
<OutputType>Library</OutputType>
9+
<AppDesignerFolder>Properties</AppDesignerFolder>
10+
<RootNamespace>FastReport.MySQL</RootNamespace>
11+
<AssemblyName>FastReport.MySQL</AssemblyName>
12+
<SignAssembly>true</SignAssembly>
13+
<AssemblyOriginatorKeyFile>..\..\FastReport.Plugins.snk</AssemblyOriginatorKeyFile>
14+
</PropertyGroup>
15+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
16+
<DebugSymbols>true</DebugSymbols>
17+
<DebugType>full</DebugType>
18+
<Optimize>false</Optimize>
19+
<OutputPath>bin\Debug\</OutputPath>
20+
<DefineConstants>DOTNET_4;DEBUG;TRACE</DefineConstants>
21+
<ErrorReport>prompt</ErrorReport>
22+
<WarningLevel>4</WarningLevel>
23+
</PropertyGroup>
24+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
25+
<DebugType>pdbonly</DebugType>
26+
<Optimize>true</Optimize>
27+
<OutputPath>bin\Release\</OutputPath>
28+
<DefineConstants>DOTNET_4;TRACE</DefineConstants>
29+
<ErrorReport>prompt</ErrorReport>
30+
<WarningLevel>4</WarningLevel>
31+
</PropertyGroup>
32+
<ItemGroup>
33+
<Reference Include="FastReport, Version=1.0.0.0, Culture=neutral, PublicKeyToken=db7e5ce63278458c, processorArchitecture=MSIL">
34+
<SpecificVersion>False</SpecificVersion>
35+
<HintPath>..\..\..\FastReport\bin\Debug\FastReport.dll</HintPath>
36+
</Reference>
37+
<Reference Include="mysql.data, Version=6.0.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL" />
38+
<Reference Include="System" />
39+
<Reference Include="System.Data" />
40+
<Reference Include="System.Design" />
41+
<Reference Include="System.Drawing" />
42+
<Reference Include="System.Web" />
43+
<Reference Include="System.Windows.Forms" />
44+
<Reference Include="System.Xml" />
45+
</ItemGroup>
46+
<ItemGroup>
47+
<Compile Include="AssemblyInitializer.cs" />
48+
<Compile Include="MySqlDataConnection.cs">
49+
<SubType>Component</SubType>
50+
</Compile>
51+
<Compile Include="MySqlConnectionEditor.cs">
52+
<SubType>UserControl</SubType>
53+
</Compile>
54+
<Compile Include="MySqlConnectionEditor.Designer.cs">
55+
<DependentUpon>MySqlConnectionEditor.cs</DependentUpon>
56+
</Compile>
57+
<Compile Include="Properties\AssemblyInfo.cs" />
58+
</ItemGroup>
59+
<ItemGroup>
60+
<EmbeddedResource Include="MySqlConnectionEditor.resx">
61+
<DependentUpon>MySqlConnectionEditor.cs</DependentUpon>
62+
<SubType>Designer</SubType>
63+
</EmbeddedResource>
64+
</ItemGroup>
65+
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
66+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
67+
Other similar extension points exist, see Microsoft.Common.targets.
68+
<Target Name="BeforeBuild">
69+
</Target>
70+
<Target Name="AfterBuild">
71+
</Target>
72+
-->
73+
</Project>

Backup/MySqlConnectionEditor.Designer.cs

Lines changed: 191 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Backup/MySqlConnectionEditor.cs

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.ComponentModel;
4+
using System.Drawing;
5+
using System.Data;
6+
using System.Text;
7+
using System.Windows.Forms;
8+
using FastReport.Data.ConnectionEditors;
9+
using FastReport.Forms;
10+
using FastReport.Utils;
11+
using MySql.Data.MySqlClient;
12+
13+
namespace FastReport.Data
14+
{
15+
public partial class MySqlConnectionEditor : ConnectionEditorBase
16+
{
17+
private string FConnectionString;
18+
19+
private void btnAdvanced_Click(object sender, EventArgs e)
20+
{
21+
using (AdvancedConnectionPropertiesForm form = new AdvancedConnectionPropertiesForm())
22+
{
23+
MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder(ConnectionString);
24+
form.AdvancedProperties = builder;
25+
if (form.ShowDialog() == DialogResult.OK)
26+
ConnectionString = form.AdvancedProperties.ToString();
27+
}
28+
}
29+
30+
private void Localize()
31+
{
32+
MyRes res = new MyRes("ConnectionEditors,Common");
33+
34+
gbServer.Text = res.Get("ServerLogon");
35+
lblServer.Text = res.Get("Server");
36+
lblUserName.Text = res.Get("UserName");
37+
lblPassword.Text = res.Get("Password");
38+
39+
gbDatabase.Text = res.Get("Database");
40+
lblDatabase.Text = res.Get("DatabaseName");
41+
btnAdvanced.Text = Res.Get("Buttons,Advanced");
42+
}
43+
44+
protected override string GetConnectionString()
45+
{
46+
MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder(FConnectionString);
47+
48+
builder.Server = tbServer.Text;
49+
builder.UserID = tbUserName.Text;
50+
builder.Password = tbPassword.Text;
51+
builder.Database = tbDatabase.Text;
52+
53+
return builder.ToString();
54+
}
55+
56+
protected override void SetConnectionString(string value)
57+
{
58+
FConnectionString = value;
59+
MySqlConnectionStringBuilder builder = new MySqlConnectionStringBuilder(value);
60+
61+
tbServer.Text = builder.Server;
62+
tbUserName.Text = builder.UserID;
63+
tbPassword.Text = builder.Password;
64+
tbDatabase.Text = builder.Database;
65+
}
66+
67+
public MySqlConnectionEditor()
68+
{
69+
InitializeComponent();
70+
Localize();
71+
}
72+
}
73+
}

0 commit comments

Comments
 (0)