Commit b5c3486e by Liv Haapala

Lisätty asetusikkuna ohjelman käynnistykseen ja lisätty näppäinyhdistelmä, millä…

… ohjelman saa suljettua.
1 parent 8cd931ef
namespace MoyaSignup
{
partial class ApiSettings
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.apiURLTextBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.SaveButton = new System.Windows.Forms.Button();
this.ApiKeyTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.ApiUserTextBox = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.ApiPassTextBox = new System.Windows.Forms.TextBox();
this.label5 = new System.Windows.Forms.Label();
this.printerModelComboBox = new System.Windows.Forms.ComboBox();
this.label6 = new System.Windows.Forms.Label();
this.webCamComboBox = new System.Windows.Forms.ComboBox();
this.printerPortComboBox = new System.Windows.Forms.ComboBox();
this.label7 = new System.Windows.Forms.Label();
this.textBox1 = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// apiURLTextBox
//
this.apiURLTextBox.Location = new System.Drawing.Point(12, 25);
this.apiURLTextBox.Name = "apiURLTextBox";
this.apiURLTextBox.Size = new System.Drawing.Size(260, 20);
this.apiURLTextBox.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 9);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(47, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Moya url";
//
// SaveButton
//
this.SaveButton.Location = new System.Drawing.Point(197, 344);
this.SaveButton.Name = "SaveButton";
this.SaveButton.Size = new System.Drawing.Size(75, 23);
this.SaveButton.TabIndex = 2;
this.SaveButton.Text = "Save";
this.SaveButton.UseVisualStyleBackColor = true;
this.SaveButton.Click += new System.EventHandler(this.SaveButton_Click);
//
// ApiKeyTextBox
//
this.ApiKeyTextBox.Location = new System.Drawing.Point(12, 68);
this.ApiKeyTextBox.Name = "ApiKeyTextBox";
this.ApiKeyTextBox.Size = new System.Drawing.Size(260, 20);
this.ApiKeyTextBox.TabIndex = 3;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 52);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(79, 13);
this.label2.TabIndex = 4;
this.label2.Text = "Application key";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(12, 91);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(47, 13);
this.label3.TabIndex = 6;
this.label3.Text = "Api User";
//
// ApiUserTextBox
//
this.ApiUserTextBox.Location = new System.Drawing.Point(12, 107);
this.ApiUserTextBox.Name = "ApiUserTextBox";
this.ApiUserTextBox.Size = new System.Drawing.Size(260, 20);
this.ApiUserTextBox.TabIndex = 5;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(12, 130);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(48, 13);
this.label4.TabIndex = 8;
this.label4.Text = "Api Pass";
//
// ApiPassTextBox
//
this.ApiPassTextBox.Location = new System.Drawing.Point(12, 146);
this.ApiPassTextBox.Name = "ApiPassTextBox";
this.ApiPassTextBox.PasswordChar = 'ῷ';
this.ApiPassTextBox.Size = new System.Drawing.Size(260, 20);
this.ApiPassTextBox.TabIndex = 7;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(12, 169);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(106, 13);
this.label5.TabIndex = 9;
this.label5.Text = "Thermo printer model";
//
// printerModelComboBox
//
this.printerModelComboBox.FormattingEnabled = true;
this.printerModelComboBox.Location = new System.Drawing.Point(12, 186);
this.printerModelComboBox.Name = "printerModelComboBox";
this.printerModelComboBox.Size = new System.Drawing.Size(260, 21);
this.printerModelComboBox.TabIndex = 10;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(12, 254);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(53, 13);
this.label6.TabIndex = 11;
this.label6.Text = "Web cam";
//
// webCamComboBox
//
this.webCamComboBox.FormattingEnabled = true;
this.webCamComboBox.Location = new System.Drawing.Point(12, 270);
this.webCamComboBox.Name = "webCamComboBox";
this.webCamComboBox.Size = new System.Drawing.Size(260, 21);
this.webCamComboBox.TabIndex = 12;
//
// printerPortComboBox
//
this.printerPortComboBox.FormattingEnabled = true;
this.printerPortComboBox.Location = new System.Drawing.Point(12, 230);
this.printerPortComboBox.Name = "printerPortComboBox";
this.printerPortComboBox.Size = new System.Drawing.Size(260, 21);
this.printerPortComboBox.TabIndex = 13;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(12, 214);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(96, 13);
this.label7.TabIndex = 14;
this.label7.Text = "Thermo printer port";
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(13, 307);
this.textBox1.Multiline = true;
this.textBox1.Name = "textBox1";
this.textBox1.ReadOnly = true;
this.textBox1.Size = new System.Drawing.Size(259, 31);
this.textBox1.TabIndex = 15;
this.textBox1.Text = "You can close the program by pressing Ctrl + Alt + S";
//
// ApiSettings
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(281, 377);
this.Controls.Add(this.textBox1);
this.Controls.Add(this.label7);
this.Controls.Add(this.printerPortComboBox);
this.Controls.Add(this.webCamComboBox);
this.Controls.Add(this.label6);
this.Controls.Add(this.printerModelComboBox);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.ApiPassTextBox);
this.Controls.Add(this.label3);
this.Controls.Add(this.ApiUserTextBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.ApiKeyTextBox);
this.Controls.Add(this.SaveButton);
this.Controls.Add(this.label1);
this.Controls.Add(this.apiURLTextBox);
this.Name = "ApiSettings";
this.Text = "ApiSettings";
this.Load += new System.EventHandler(this.ApiSettings_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox apiURLTextBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button SaveButton;
private System.Windows.Forms.TextBox ApiKeyTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox ApiUserTextBox;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox ApiPassTextBox;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.ComboBox printerModelComboBox;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.ComboBox webCamComboBox;
private System.Windows.Forms.ComboBox printerPortComboBox;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox textBox1;
}
}
\ No newline at end of file
using MoyaAdminLib;
using MoyaAdminUI.MoyaAPI;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.IO.Ports;
using System.Linq;
using System.Management;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Touchless.Vision.Camera;
namespace MoyaSignup
{
public partial class ApiSettings : Form
{
public ApiSettings()
{
InitializeComponent();
}
private void SaveButton_Click(object sender, EventArgs e)
{
Properties.Settings.Default.ApiURL = apiURLTextBox.Text;
Properties.Settings.Default.ApiApplicationKey = ApiKeyTextBox.Text;
Properties.Settings.Default.ApiUser = ApiUserTextBox.Text;
Properties.Settings.Default.ApiPass = ApiPassTextBox.Text;
if(printerModelComboBox.SelectedItem != null)
{
Properties.Settings.Default.ThermoPrinter = (int) printerModelComboBox.SelectedItem;
}
if(printerPortComboBox.SelectedItem != null)
{
string comPort = (string)this.printerPortComboBox.SelectedItem;
Debug.WriteLine("[ApiSettings] Selected modemport is '" + comPort + "'");
foreach (string p in SerialPort.GetPortNames())
{
if (comPort == p || comPort.Contains("(" + p + ")"))
{
Debug.WriteLine("[ApiSettings] Setting modemport to '" + p + "'");
Properties.Settings.Default.printerPort = p;
break;
}
}
}
if(webCamComboBox.SelectedItem != null)
{
Properties.Settings.Default.Camera = (string)webCamComboBox.SelectedItem;
}
Properties.Settings.Default.Save();
RestClient.ApiApplicationKey = Properties.Settings.Default.ApiApplicationKey;
RestClient.ApiPass = Properties.Settings.Default.ApiPass;
RestClient.ApiUser = Properties.Settings.Default.ApiUser;
RestClient.ApiURL = Properties.Settings.Default.ApiURL;
this.DialogResult = System.Windows.Forms.DialogResult.OK;
}
private void ApiSettings_Load(object sender, EventArgs e)
{
apiURLTextBox.Text = Properties.Settings.Default.ApiURL;
ApiKeyTextBox.Text = Properties.Settings.Default.ApiApplicationKey;
ApiUserTextBox.Text = Properties.Settings.Default.ApiUser;
ApiPassTextBox.Text = Properties.Settings.Default.ApiPass;
printerModelComboBox.Items.Add(ThermoPrinterLibrary.ThermoPrinter.Models.IDP3210);
printerModelComboBox.Items.Add(ThermoPrinterLibrary.ThermoPrinter.Models.TMT188II);
printerPortComboBox.Items.Clear();
try
{
using (var searcher = new ManagementObjectSearcher("root\\CIMV2", "SELECT * FROM Win32_PnPEntity"))
{
string[] portnames = SerialPort.GetPortNames();
foreach (ManagementObject queryObj in searcher.Get())
{
if (queryObj["Caption"] != null)
{
string port = queryObj["Caption"].ToString();
if (port.Contains("(COM"))
{
printerPortComboBox.Items.Add(port);
}
}
}
}
}
catch (Exception ex)
{
Debug.WriteLine("Failed to get serial ports. Trying with the old way..");
if (printerPortComboBox.Items.Count == 0)
{
foreach (string p in SerialPort.GetPortNames())
{
SerialPort port = new SerialPort(p);
try
{
port.Open();
port.Close();
}
catch
{
continue;
}
printerPortComboBox.Items.Add(p);
}
}
}
foreach(Camera cam in CameraService.AvailableCameras)
{
webCamComboBox.Items.Add(cam.Name);
}
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
\ No newline at end of file
namespace RamaSignup namespace MoyaSignup
{ {
partial class Form1 partial class Form1
{ {
...@@ -33,8 +33,8 @@ ...@@ -33,8 +33,8 @@
this.btnEnglish = new System.Windows.Forms.Button(); this.btnEnglish = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel(); this.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button(); this.button1 = new System.Windows.Forms.Button();
this.userDetailsEditor1 = new RamaSignup.UserDetailsEditor(); this.userDetailsEditor1 = new MoyaSignup.UserDetailsEditor();
this.userLoginControl1 = new RamaSignup.UserLoginControl(); this.userLoginControl1 = new MoyaSignup.UserLoginControl();
this.SuspendLayout(); this.SuspendLayout();
// //
// btnFinnish // btnFinnish
...@@ -100,7 +100,7 @@ ...@@ -100,7 +100,7 @@
// //
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = global::RamaSignup.Properties.Resources.vecto_tausta; this.BackgroundImage = global::MoyaSignup.Properties.Resources.vecto_tausta;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch; this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(1058, 768); this.ClientSize = new System.Drawing.Size(1058, 768);
this.Controls.Add(this.userDetailsEditor1); this.Controls.Add(this.userDetailsEditor1);
......
...@@ -13,13 +13,14 @@ using MoyaAdminLib; ...@@ -13,13 +13,14 @@ using MoyaAdminLib;
using System.Diagnostics; using System.Diagnostics;
using ThermoPrinterLibrary; using ThermoPrinterLibrary;
namespace RamaSignup namespace MoyaSignup
{ {
public partial class Form1 : Form public partial class Form1 : Form
{ {
ThermoPrinter thermoPrinter; ThermoPrinter thermoPrinter;
//public delegate void ThermoPrinterEvent(ThermoPrinter.Models model);
//public event ThermoPrinterEvent SetPrinter;
public Form1() public Form1()
{ {
...@@ -78,15 +79,24 @@ namespace RamaSignup ...@@ -78,15 +79,24 @@ namespace RamaSignup
private void Form1_Load(object sender, EventArgs e) private void Form1_Load(object sender, EventArgs e)
{ {
if (AutoUpdateLib.AutoUpdateCore.CheckForUpdates(null)) /*if (AutoUpdateLib.AutoUpdateCore.CheckForUpdates(null))
{ {
Application.ExitThread(); //program is required to close by autoupdate (probably updated) Application.ExitThread(); //program is required to close by autoupdate (probably updated)
return; return;
} }*/
if (Debugger.IsAttached) if (Debugger.IsAttached)
this.WindowState = FormWindowState.Normal; this.WindowState = FormWindowState.Normal;
ApiSettings form = new ApiSettings();
form.ShowDialog();
if(Properties.Settings.Default.printerPort != null && Properties.Settings.Default.ThermoPrinter > 0)
{
ThermoPrinter.Models model = (ThermoPrinter.Models)Properties.Settings.Default.ThermoPrinter;
SetPrinter(model);
}
userLoginControl1.SetPrinter += SetPrinter; userLoginControl1.SetPrinter += SetPrinter;
} }
...@@ -137,6 +147,10 @@ namespace RamaSignup ...@@ -137,6 +147,10 @@ namespace RamaSignup
bool allowShutdown; bool allowShutdown;
public bool AllowShutdown {
get { return allowShutdown; }
set { allowShutdown = value; }
}
/* /*
private void txtName_TextChanged(object sender, EventArgs e) private void txtName_TextChanged(object sender, EventArgs e)
{ {
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
<ProjectGuid>{7264F333-9419-4208-AA6D-223D4CE19C05}</ProjectGuid> <ProjectGuid>{7264F333-9419-4208-AA6D-223D4CE19C05}</ProjectGuid>
<OutputType>WinExe</OutputType> <OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder> <AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RamaSignup</RootNamespace> <RootNamespace>MoyaSignup</RootNamespace>
<AssemblyName>RamaSignup</AssemblyName> <AssemblyName>MoyaSignup</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment> <FileAlignment>512</FileAlignment>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent> <RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
<Reference Include="System.Core"> <Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.Management" />
<Reference Include="System.Web.Extensions" /> <Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq"> <Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework> <RequiredTargetFramework>3.5</RequiredTargetFramework>
...@@ -99,6 +100,12 @@ ...@@ -99,6 +100,12 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="API32.cs" /> <Compile Include="API32.cs" />
<Compile Include="ApiSettings.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="ApiSettings.Designer.cs">
<DependentUpon>ApiSettings.cs</DependentUpon>
</Compile>
<Compile Include="Filters.cs" /> <Compile Include="Filters.cs" />
<Compile Include="Form1.cs"> <Compile Include="Form1.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
...@@ -115,6 +122,9 @@ ...@@ -115,6 +122,9 @@
<Compile Include="mjpeg\SourceDescriptions.cs" /> <Compile Include="mjpeg\SourceDescriptions.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="ApiSettings.resx">
<DependentUpon>ApiSettings.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Form1.resx"> <EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon> <DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
......
...@@ -3,10 +3,12 @@ using System.Collections.Generic; ...@@ -3,10 +3,12 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
namespace RamaSignup namespace MoyaSignup
{ {
static class Program static class Program
{ {
public static Form1 form1;
/// <summary> /// <summary>
/// The main entry point for the application. /// The main entry point for the application.
/// </summary> /// </summary>
...@@ -26,7 +28,9 @@ namespace RamaSignup ...@@ -26,7 +28,9 @@ namespace RamaSignup
Properties.Settings.Default.ApplicationVersion = appVersionString; Properties.Settings.Default.ApplicationVersion = appVersionString;
} }
Application.Run(new Form1()); form1 = new Form1();
Application.Run(form1);
} }
} }
} }
...@@ -5,11 +5,11 @@ using System.Runtime.InteropServices; ...@@ -5,11 +5,11 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following // General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information // set of attributes. Change these attribute values to modify the information
// associated with an assembly. // associated with an assembly.
[assembly: AssemblyTitle("RamaSignup")] [assembly: AssemblyTitle("MoyaSignup")]
[assembly: AssemblyDescription("")] [assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")] [assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Oem")] [assembly: AssemblyCompany("Oem")]
[assembly: AssemblyProduct("RamaSignup")] [assembly: AssemblyProduct("MoyaSignup")]
[assembly: AssemblyCopyright("Copyright © Oem 2008")] [assembly: AssemblyCopyright("Copyright © Oem 2008")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")] [assembly: AssemblyCulture("")]
......
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// <auto-generated> // <auto-generated>
// This code was generated by a tool. // This code was generated by a tool.
// Runtime Version:4.0.30319.34209 // Runtime Version:4.0.30319.42000
// //
// Changes to this file may cause incorrect behavior and will be lost if // Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated. // the code is regenerated.
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace RamaSignup.Properties { namespace MoyaSignup.Properties {
using System; using System;
...@@ -39,7 +39,7 @@ namespace RamaSignup.Properties { ...@@ -39,7 +39,7 @@ namespace RamaSignup.Properties {
internal static global::System.Resources.ResourceManager ResourceManager { internal static global::System.Resources.ResourceManager ResourceManager {
get { get {
if (object.ReferenceEquals(resourceMan, null)) { if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RamaSignup.Properties.Resources", typeof(Resources).Assembly); global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MoyaSignup.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp; resourceMan = temp;
} }
return resourceMan; return resourceMan;
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
// </auto-generated> // </auto-generated>
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
namespace RamaSignup.Properties { namespace MoyaSignup.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
...@@ -85,10 +85,10 @@ namespace RamaSignup.Properties { ...@@ -85,10 +85,10 @@ namespace RamaSignup.Properties {
[global::System.Configuration.UserScopedSettingAttribute()] [global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("TMT188II")] [global::System.Configuration.DefaultSettingValueAttribute("0")]
public string ThermoPrinter { public int ThermoPrinter {
get { get {
return ((string)(this["ThermoPrinter"])); return ((int)(this["ThermoPrinter"]));
} }
set { set {
this["ThermoPrinter"] = value; this["ThermoPrinter"] = value;
......
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="RamaSignup.Properties" GeneratedClassName="Settings"> <SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="MoyaSignup.Properties" GeneratedClassName="Settings">
<Profiles /> <Profiles />
<Settings> <Settings>
<Setting Name="ApiApplicationKey" Type="System.String" Scope="User"> <Setting Name="ApiApplicationKey" Type="System.String" Scope="User">
...@@ -17,8 +17,8 @@ ...@@ -17,8 +17,8 @@
<Setting Name="Port" Type="System.String" Scope="User"> <Setting Name="Port" Type="System.String" Scope="User">
<Value Profile="(Default)" /> <Value Profile="(Default)" />
</Setting> </Setting>
<Setting Name="ThermoPrinter" Type="System.String" Scope="User"> <Setting Name="ThermoPrinter" Type="System.Int32" Scope="User">
<Value Profile="(Default)">TMT188II</Value> <Value Profile="(Default)">0</Value>
</Setting> </Setting>
<Setting Name="Camera" Type="System.String" Scope="User"> <Setting Name="Camera" Type="System.String" Scope="User">
<Value Profile="(Default)">Mobius</Value> <Value Profile="(Default)">Mobius</Value>
......
namespace RamaSignup namespace MoyaSignup
{ {
partial class TakePictureControl partial class TakePictureControl
{ {
......
...@@ -17,7 +17,7 @@ using System.Collections.Specialized; ...@@ -17,7 +17,7 @@ using System.Collections.Specialized;
using System.Drawing.Imaging; using System.Drawing.Imaging;
using System.Diagnostics; using System.Diagnostics;
namespace RamaSignup namespace MoyaSignup
{ {
public partial class TakePictureControl : UserControl public partial class TakePictureControl : UserControl
{ {
...@@ -200,13 +200,24 @@ namespace RamaSignup ...@@ -200,13 +200,24 @@ namespace RamaSignup
{ {
try try
{ {
Camera c = null; string camera = null;
if (Properties.Settings.Default.Camera != null)
camera = Properties.Settings.Default.Camera;
Camera c = null;
if (Debugger.IsAttached) if (Debugger.IsAttached)
{ {
foreach (Camera cam in CameraService.AvailableCameras) foreach (Camera cam in CameraService.AvailableCameras)
{ {
if (cam.Name.ToLower().Contains("mobius")) if (camera != null && cam.Name == camera)
{
c = cam; c = cam;
break;
}
else if (cam.Name.ToLower().Contains("mobius"))
{
c = cam;
break;
}
} }
} }
if(c == null) if(c == null)
......
...@@ -3,7 +3,7 @@ using System.Collections.Generic; ...@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
namespace RamaSignup namespace MoyaSignup
{ {
class TicketType class TicketType
{ {
......
namespace RamaSignup namespace MoyaSignup
{ {
partial class UserDetailsEditor partial class UserDetailsEditor
{ {
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
this.btnSaveData = new System.Windows.Forms.Button(); this.btnSaveData = new System.Windows.Forms.Button();
this.btnCancel = new System.Windows.Forms.Button(); this.btnCancel = new System.Windows.Forms.Button();
this.txtAge = new System.Windows.Forms.TextBox(); this.txtAge = new System.Windows.Forms.TextBox();
this.takePictureControl1 = new RamaSignup.TakePictureControl(); this.takePictureControl1 = new MoyaSignup.TakePictureControl();
this.SuspendLayout(); this.SuspendLayout();
// //
// label11 // label11
......
...@@ -17,7 +17,7 @@ using ThermoPrinterLibrary; ...@@ -17,7 +17,7 @@ using ThermoPrinterLibrary;
using System.Text.RegularExpressions; using System.Text.RegularExpressions;
using System.Threading; using System.Threading;
namespace RamaSignup namespace MoyaSignup
{ {
public partial class UserDetailsEditor : UserControl public partial class UserDetailsEditor : UserControl
{ {
......
namespace RamaSignup namespace MoyaSignup
{ {
partial class UserLoginControl partial class UserLoginControl
{ {
...@@ -61,6 +61,7 @@ ...@@ -61,6 +61,7 @@
this.txtEmail.Size = new System.Drawing.Size(395, 26); this.txtEmail.Size = new System.Drawing.Size(395, 26);
this.txtEmail.TabIndex = 67; this.txtEmail.TabIndex = 67;
this.txtEmail.TextChanged += new System.EventHandler(this.txtEmail_TextChanged); this.txtEmail.TextChanged += new System.EventHandler(this.txtEmail_TextChanged);
this.txtEmail.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtEmail_KeyUp);
// //
// timer1 // timer1
// //
...@@ -136,6 +137,7 @@ ...@@ -136,6 +137,7 @@
this.Name = "UserLoginControl"; this.Name = "UserLoginControl";
this.Size = new System.Drawing.Size(420, 126); this.Size = new System.Drawing.Size(420, 126);
this.Load += new System.EventHandler(this.UserLoginControl_Load); this.Load += new System.EventHandler(this.UserLoginControl_Load);
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.UserLoginControl_KeyUp);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout(); this.PerformLayout();
......
...@@ -12,7 +12,7 @@ using System.Web.Script.Serialization; ...@@ -12,7 +12,7 @@ using System.Web.Script.Serialization;
using System.Net; using System.Net;
using ThermoPrinterLibrary; using ThermoPrinterLibrary;
namespace RamaSignup namespace MoyaSignup
{ {
public partial class UserLoginControl : UserControl public partial class UserLoginControl : UserControl
{ {
...@@ -194,5 +194,36 @@ namespace RamaSignup ...@@ -194,5 +194,36 @@ namespace RamaSignup
infoLabel.Text = "Hei! Kirjoita sähköpostiosoitteesi"; infoLabel.Text = "Hei! Kirjoita sähköpostiosoitteesi";
loginButton.Visible = false; loginButton.Visible = false;
} }
private void UserLoginControl_KeyUp(object sender, KeyEventArgs e)
{
if (e.Alt && e.Control && e.KeyCode == Keys.S)
{
Application.Exit();
return;
}
else if (e.Alt && e.KeyCode == Keys.F5)
{
//userDetailsEditor1.SetPrinter(ThermoPrinterLibrary.ThermoPrinter.Models.IDP3210);
//MessageBox.Show("Printteri: IDP3210");
}
}
private void txtEmail_KeyUp(object sender, KeyEventArgs e)
{
if (e.Alt && e.Control && e.KeyCode == Keys.S)
{
Program.form1.AllowShutdown = true;
Application.Exit();
return;
}
else if (e.Alt && e.KeyCode == Keys.F5)
{
//userDetailsEditor1.SetPrinter(ThermoPrinterLibrary.ThermoPrinter.Models.IDP3210);
//MessageBox.Show("Printteri: IDP3210");
}
}
} }
} }
...@@ -3,7 +3,7 @@ using System.Collections.Generic; ...@@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
namespace RamaSignup namespace MoyaSignup
{ {
public static class Util public static class Util
{ {
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<configuration> <configuration>
<configSections> <configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<section name="RamaSignup.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/> <section name="MoyaSignup.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false"/>
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<runtime> <runtime>
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</assemblyBinding> </assemblyBinding>
</runtime> </runtime>
<userSettings> <userSettings>
<RamaSignup.Properties.Settings> <MoyaSignup.Properties.Settings>
<setting name="ApiApplicationKey" serializeAs="String"> <setting name="ApiApplicationKey" serializeAs="String">
<value>myapiclientid</value> <value>myapiclientid</value>
</setting> </setting>
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
<value /> <value />
</setting> </setting>
<setting name="ThermoPrinter" serializeAs="String"> <setting name="ThermoPrinter" serializeAs="String">
<value>TMT188II</value> <value>0</value>
</setting> </setting>
<setting name="Camera" serializeAs="String"> <setting name="Camera" serializeAs="String">
<value>Mobius</value> <value>Mobius</value>
...@@ -42,6 +42,6 @@ ...@@ -42,6 +42,6 @@
<setting name="ApiURL" serializeAs="String"> <setting name="ApiURL" serializeAs="String">
<value>http://myapi.moya.endpoint/MoyaWeb</value> <value>http://myapi.moya.endpoint/MoyaWeb</value>
</setting> </setting>
</RamaSignup.Properties.Settings> </MoyaSignup.Properties.Settings>
</userSettings> </userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration> <startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
...@@ -9,11 +9,11 @@ namespace ThermoPrinterLibrary ...@@ -9,11 +9,11 @@ namespace ThermoPrinterLibrary
{ {
public class ThermoPrinter public class ThermoPrinter
{ {
public enum Models public enum Models: int
{ {
Unknown, Unknown = 0,
IDP3210, IDP3210 = 1,
TMT188II TMT188II = 2
} }
public enum Commands: byte public enum Commands: byte
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!