Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions BTConnectionService/BTConnectionService.sln
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.26730.16
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BTConnectionService", "BTConnectionService\BTConnectionService.csproj", "{2488A216-B753-42BB-A3DC-48B3DAB02B24}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinRemoteDesktop_Test", "WinRemoteDesktop_Test\WinRemoteDesktop_Test.csproj", "{DB80291E-30EE-4A3C-8774-80508595DF2E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand All @@ -15,6 +17,10 @@ Global
{2488A216-B753-42BB-A3DC-48B3DAB02B24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{2488A216-B753-42BB-A3DC-48B3DAB02B24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{2488A216-B753-42BB-A3DC-48B3DAB02B24}.Release|Any CPU.Build.0 = Release|Any CPU
{DB80291E-30EE-4A3C-8774-80508595DF2E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DB80291E-30EE-4A3C-8774-80508595DF2E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DB80291E-30EE-4A3C-8774-80508595DF2E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DB80291E-30EE-4A3C-8774-80508595DF2E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
<Compile Include="model\DBButton.cs" />
<Compile Include="model\DBKeyCode.cs" />
<Compile Include="model\DBMacro.cs" />
<Compile Include="utils\KeySend.cs" />
<Compile Include="utils\Log.cs" />
<Compile Include="view\Start.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
25 changes: 25 additions & 0 deletions BTConnectionService/BTConnectionService/utils/KeySend.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using winRemoteDataBase.Model;

namespace BTConnectionService
{
class KeySend
{
public void stringSend(string str)
{
Log.write("stringSend to focused application; value: " + str);
SendKeys.Send(str);
}

public void buttonSend(DBButton dbBtn)
{


}
}
}
27 changes: 27 additions & 0 deletions BTConnectionService/WinRemoteDesktop_Test/App.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
<parameters>
<parameter value="v13.0" />
</parameters>
</defaultConnectionFactory>
<providers>
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
<remove invariant="System.Data.SQLite" /><add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
</system.data>
</configuration>
174 changes: 174 additions & 0 deletions BTConnectionService/WinRemoteDesktop_Test/ButtonForm.Designer.cs

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

93 changes: 93 additions & 0 deletions BTConnectionService/WinRemoteDesktop_Test/ButtonForm.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
using System;
using System.Collections;
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 WinRemoteDesktop_Test
{
public partial class ButtonForm : Form
{
public ButtonForm()
{
InitializeComponent();
fillDataGrids();

btnTempDataGrid.ColumnCount = 2;
btnTempDataGrid.Columns[0].Name = "Command ID";
btnTempDataGrid.Columns[1].Name = "Description";
macroDataGrid.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
btnTempDataGrid.SelectionMode = DataGridViewSelectionMode.FullRowSelect;

}

private void fillDataGrids()
{
macroDataGrid.DataSource = DBHelper.grabDataset("WR_Macro").Tables[0].DefaultView;
}

private void addTempButton(string ID, string desc)
{
btnTempDataGrid.Rows.Add(ID, desc);
}

private void addMacroBtn_Click(object sender, EventArgs e)
{
string ID = "", desc = "";

foreach(DataGridViewRow row in macroDataGrid.SelectedRows)
{
ID = row.Cells[0].Value.ToString();
desc = row.Cells[1].Value.ToString();
}

addTempButton(ID, desc);

}

private void ButtonForm_Load(object sender, EventArgs e)
{

}

private void removeMacroBtn_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in btnTempDataGrid.SelectedRows)
{
btnTempDataGrid.Rows.RemoveAt(row.Index);
}
}

private void saveBtn_Click(object sender, EventArgs e)
{
ArrayList macroIDs = new ArrayList();
string ID = "";
foreach (DataGridViewRow row in btnTempDataGrid.Rows)
{
ID = row.Cells[0].Value.ToString();
macroIDs.Add(ID);
//MessageBox.Show(ID);
}

string csvcmd = string.Join(",", (string[])macroIDs.ToArray(Type.GetType("System.String")));
string tag = "BTN";
string description = descTxtBox.Text;

DBHelper.createSimpleMacro(csvcmd, tag, "customer user button");
string mcid = DBHelper.getNewBtnID();
DBHelper.createSimpleButton(mcid, description);
this.Close();

}

private void descTxtBox_TextChanged(object sender, EventArgs e)
{

}
}
}
Loading