Skip to content

Commit

Permalink
[qr] add share qr
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinZonda committed Sep 25, 2020
1 parent e9860aa commit 811d204
Show file tree
Hide file tree
Showing 8 changed files with 1,315 additions and 2 deletions.
2 changes: 1 addition & 1 deletion NaiveSharp.Test/NaiveSharp.Test.csproj
Expand Up @@ -8,7 +8,7 @@

<ItemGroup>
<PackageReference Include="Appveyor.TestLogger" Version="2.0.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.7.1" />
<PackageReference Include="MSTest.TestAdapter" Version="2.1.2" />
<PackageReference Include="MSTest.TestFramework" Version="2.1.2" />
<PackageReference Include="coverlet.collector" Version="1.3.0">
Expand Down
16 changes: 16 additions & 0 deletions NaiveSharp/NaiveSharp.csproj
Expand Up @@ -83,6 +83,11 @@
<ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup>
<ItemGroup>
<Reference Include="Gma.QrCodeNet.Encoding, Version=0.4.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\QrCode.Net.0.4.0.0\lib\net45\Gma.QrCodeNet.Encoding.dll</HintPath>
</Reference>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Web" />
Expand All @@ -95,6 +100,7 @@
<Reference Include="System.Net.Http" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="WindowsBase" />
</ItemGroup>
<ItemGroup>
<Compile Include="ConstText\Msg.cs" />
Expand Down Expand Up @@ -138,6 +144,12 @@
<Compile Include="View\MainWindowsEx.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="View\Qr.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="View\Qr.Designer.cs">
<DependentUpon>Qr.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
Expand All @@ -154,7 +166,11 @@
<EmbeddedResource Include="View\MainWindow.resx">
<DependentUpon>MainWindow.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="View\Qr.resx">
<DependentUpon>Qr.cs</DependentUpon>
</EmbeddedResource>
<None Include="app.manifest" />
<None Include="packages.config" />
<None Include="Properties\app.manifest" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
Expand Down
18 changes: 17 additions & 1 deletion NaiveSharp/View/MainWindow.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions NaiveSharp/View/MainWindow.cs
Expand Up @@ -492,5 +492,11 @@ private void btnDel_Click(object sender, EventArgs e)

tvwNodeList.Enabled = true;
}

private void btnQR_Click(object sender, EventArgs e)
{
var frmQr = new Qr(Sharelink.Generate());
frmQr.ShowDialog();
}
}
}
91 changes: 91 additions & 0 deletions NaiveSharp/View/Qr.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions NaiveSharp/View/Qr.cs
@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;


namespace NaiveSharp.View
{
public partial class Qr : Form
{
public Qr(string sharelink)
{
InitializeComponent();

txtSharelink.Text = qrcQrImg.Text = sharelink;
}

private void Qr_Load(object sender, EventArgs e)
{

}

private void btnOK_Click(object sender, EventArgs e)
{
this.Close();
}

private void txtSharelink_MouseUp(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
((TextBox)sender).SelectAll();
}
}
}
}

0 comments on commit 811d204

Please sign in to comment.