Commit dd63eef5 by Liv Haapala

Merge branch 'master' of gitlab.codecrew.fi:liv/moya-info-tools

Conflicts:
	MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache
	MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/MoyaAdminLib.dll
	MoyaAdmin/MoyaAdminUI/MoyaAdminLib/obj/Debug/MoyaAdminLib.pdb
	MoyaAdmin/MoyaAdminUI/MoyaAdminUI/MainForm.Designer.cs
2 parents 258f0580 f8150914
Showing with 4811 additions and 13 deletions
......@@ -61,6 +61,8 @@ namespace MoyaAdminLib
ContentType = "application/json";
PostData = postData;
}
public static string CalculateSHA1(string text)
{
// Convert the input string to a byte array
......@@ -87,21 +89,41 @@ namespace MoyaAdminLib
return (int)span.TotalSeconds;
}
public static string GetRequestURL(string server, string parameters)
public static string GetRequestURL(string server, string queryPath)
{
return GetRequestURL(server, queryPath,null);
}
public static string GetRequestURL(string server, string queryPath, string getparms)
{
int timestamp = ConvertToTimestamp(DateTime.Now);
string hash = CalculateSHA1("/" + parameters + "+" + ApiApplicationKey + "+" + ApiUser + "+" + timestamp + "+" + ApiPass);
string url = server + "/rest/" + parameters + "?appkey=" + ApiApplicationKey + "&appuser=" + ApiUser + "&appstamp=" + timestamp + "&appmac=" + hash;
string hash = CalculateSHA1("/" + queryPath + "+" + ApiApplicationKey + "+" + ApiUser + "+" + timestamp + "+" + ApiPass);
if (getparms != null && getparms.Length > 0)
getparms = getparms + "&";
string url = server + "/rest/" + queryPath + "?";
if (getparms != null)
url += getparms;
url += "appkey=" + ApiApplicationKey + "&appuser=" + ApiUser + "&appstamp=" + timestamp + "&appmac=" + hash;
Console.WriteLine(url);
return url;
}
public string MakeRequest(string parameters)
public string MakeRequest(string queryPath)
{
return MakeRequest(queryPath, null);
}
public string MakeRequest(string queryPath, string getparms)
{
///placeadmin/places/30+abcdefg+testuser-asdf+1393735570144+acdcabbacd
///
var request = (HttpWebRequest)WebRequest.Create(GetRequestURL(EndPoint,parameters));
var request = (HttpWebRequest)WebRequest.Create(GetRequestURL(EndPoint,queryPath,getparms));
request.Method = Method.ToString();
......@@ -151,7 +173,8 @@ namespace MoyaAdminLib
}
catch (WebException e)
{
if (e.Status == WebExceptionStatus.ConnectFailure)
throw e;
Stream responseStream = ((WebException)e).Response.GetResponseStream();
if (responseStream != null)
......
......@@ -15,7 +15,10 @@ namespace MoyaAdminLib
{
APIreference = user;
}
public User()
{
APIreference = new Eventuser();
}
private Eventuser APIreference;
public Eventuser APIReference
{
......@@ -28,11 +31,13 @@ namespace MoyaAdminLib
{
get { return APIreference.eventuserId; }
}
/*
/// <summary>
/// User global id. Usual you want event user id!
/// </summary>
public int UserId
{
get { return APIreference.userId; }
}*/
}
public string Nick
{
......@@ -54,10 +59,44 @@ namespace MoyaAdminLib
get { return APIreference.login; }
}
public string Birthday
{
get {return APIreference.birthday;}
}
//MALE FEMALE UNDEFINED
public string Gender
{
get {return APIreference.gender;}
}
public string Email;
public string PhoneNumber
{
get {return APIreference.phoneNumber;}
}
public string StreetAddress
{
get { return APIreference.streetAddress; }
}
public string ZipCode
{
get { return APIreference.zipCode; }
}
public string postOffice
{
get { return APIreference.postOffice; }
}
public override string ToString()
{
return this.Firstname + " "+ Lastname;
return this.Firstname + " " + Lastname;
}
public static List<User> Cache = new List<User>();
public static void LoadAll()
......
......@@ -7,6 +7,20 @@ using System.Threading.Tasks;
namespace MoyaAdminLib
{
//"eventuserId":7019,"firstname":"Topi","lastname":"Kinnunen","login":"xxtopotxx","userId":4902,"nick":"xXtopotXx"},
/* {
"nick": "jkj",
"login": "jkj",
"eventuserId": 7913,
"userId": 219,
"firstname": "Juho",
"lastname": "Juopperi",
"birthday": "1984-08-02T00:00:00+03:00",
"gender": "MALE",
"phoneNumber": "+358405422321",
"streetAddress": "Kaitoväylä 14 A 1",
"zipCode": "90571",
"postOffice": ""
}*/
public class Eventuser
{
public int eventuserId;
......@@ -15,6 +29,12 @@ namespace MoyaAdminLib
public string login;
public int userId;
public string nick;
public string birthday;
public string gender;
public string phoneNumber;
public string streetAddress;
public string zipCode;
public string postOffice;
}
}
......@@ -19,3 +19,5 @@ D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Debug\MoyaAdminLib.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Debug\MoyaAdminLib.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Debug\MoyaAdminLib.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Debug\MoyaAdminLib.csprojResolveAssemblyReference.cache
I:\devel\proj\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Debug\MoyaAdminLib.csprojResolveAssemblyReference.cache
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Release\MoyaAdminLib.dll.config
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Release\MoyaAdminLib.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\bin\Release\MoyaAdminLib.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Release\MoyaAdminLib.Controls.EventUserEditor.resources
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Release\MoyaAdminLib.csproj.GenerateResource.Cache
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Release\MoyaAdminLib.dll
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Release\MoyaAdminLib.pdb
D:\Devel\proj\moya-info-tools\moya-info-tools\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\obj\Release\MoyaAdminLib.csprojResolveAssemblyReference.cache

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Express 2012 for Windows Desktop
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaAdminUI", "MoyaAdminUI\MoyaAdminUI.csproj", "{56D4C2A6-B4A2-4E40-ACFB-19E188AAD703}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaAdminLib", "MoyaAdminLib\MoyaAdminLib.csproj", "{095CE28F-5B53-4203-85C6-3A9AFD486407}"
......
......@@ -75,7 +75,8 @@
// placesContextMenuStrip
//
this.placesContextMenuStrip.Name = "placesContextMenuStrip";
this.placesContextMenuStrip.Size = new System.Drawing.Size(61, 4);
this.placesContextMenuStrip.Size = new System.Drawing.Size(153, 26);
this.placesContextMenuStrip.Opening += new System.ComponentModel.CancelEventHandler(this.placesContextMenuStrip_Opening);
//
// MapPictureBox
//
......@@ -302,6 +303,9 @@
this.label2.Size = new System.Drawing.Size(46, 13);
this.label2.TabIndex = 9;
this.label2.Text = "Avoinna";
this.label2.Size = new System.Drawing.Size(50, 13);
this.label2.TabIndex = 9;
this.label2.Text = "Vapaana";
//
// reservedPlacesCountTextBox
//
......
......@@ -1265,6 +1265,11 @@ namespace MoyaAdminUI
refreshPlacesCountTexBoxes();
}
private void placesContextMenuStrip_Opening(object sender, CancelEventArgs e)
{
}
}
......
namespace WebCam
{
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
public class API32
{
// API32 calls
[DllImport("avicap32.dll")] public static extern IntPtr capCreateCaptureWindowA(byte[] lpszWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, IntPtr hWndParent, int nID);
[DllImport("avicap32.dll")] public static extern bool capGetDriverDescriptionA(short wDriver, byte[] lpszName, int cbName, byte[] lpszVer, int cbVer);
[DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, bool wParam, int lParam);
[DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, short wParam, int lParam);
[DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, short wParam, FrameEventHandler lParam);
[DllImport("User32.dll")] public static extern bool SendMessage(IntPtr hWnd, int wMsg, int wParam, ref BITMAPINFO lParam);
[DllImport("User32.dll")] public static extern int SetWindowPos(IntPtr hWnd, int hWndInsertAfter, int x, int y, int cx, int cy, int wFlags);
[DllImport("avicap32.dll")]public static extern int capGetVideoFormat(IntPtr hWnd, IntPtr psVideoFormat, int wSize );
// Constants
public const int WM_USER = 0x400;
public const int WS_CHILD = 0x40000000;
public const int WS_VISIBLE = 0x10000000;
public const int SWP_NOMOVE = 0x2;
public const int SWP_NOZORDER = 0x4;
public const int WM_CAP_DRIVER_CONNECT = WM_USER + 10;
public const int WM_CAP_DRIVER_DISCONNECT = WM_USER + 11;
public const int WM_CAP_SET_CALLBACK_FRAME = WM_USER + 5;
public const int WM_CAP_SET_PREVIEW = WM_USER + 50;
public const int WM_CAP_SET_PREVIEWRATE = WM_USER + 52;
public const int WM_CAP_SET_VIDEOFORMAT = WM_USER + 45;
public const int WM_CAP_DLG_VIDEODISPLAY = 0x42b;
public const int WM_CAP_DLG_VIDEOFORMAT = 0x429;
public const int WM_CAP_DLG_VIDEOSOURCE = 0x42a;
// Structures
[StructLayout(LayoutKind.Sequential)] public struct VIDEOHDR
{
[MarshalAs(UnmanagedType.I4)] public int lpData;
[MarshalAs(UnmanagedType.I4)] public int dwBufferLength;
[MarshalAs(UnmanagedType.I4)] public int dwBytesUsed;
[MarshalAs(UnmanagedType.I4)] public int dwTimeCaptured;
[MarshalAs(UnmanagedType.I4)] public int dwUser;
[MarshalAs(UnmanagedType.I4)] public int dwFlags;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=4)] public int[] dwReserved;
}
[StructLayout(LayoutKind.Sequential)] public struct BITMAPINFOHEADER
{
[MarshalAs(UnmanagedType.I4)] public Int32 biSize ;
[MarshalAs(UnmanagedType.I4)] public Int32 biWidth ;
[MarshalAs(UnmanagedType.I4)] public Int32 biHeight ;
[MarshalAs(UnmanagedType.I2)] public short biPlanes;
[MarshalAs(UnmanagedType.I2)] public short biBitCount ;
[MarshalAs(UnmanagedType.I4)] public Int32 biCompression;
[MarshalAs(UnmanagedType.I4)] public Int32 biSizeImage;
[MarshalAs(UnmanagedType.I4)] public Int32 biXPelsPerMeter;
[MarshalAs(UnmanagedType.I4)] public Int32 biYPelsPerMeter;
[MarshalAs(UnmanagedType.I4)] public Int32 biClrUsed;
[MarshalAs(UnmanagedType.I4)] public Int32 biClrImportant;
}
[StructLayout(LayoutKind.Sequential)] public struct BITMAPINFO
{
[MarshalAs(UnmanagedType.Struct, SizeConst=40)] public BITMAPINFOHEADER bmiHeader;
[MarshalAs(UnmanagedType.ByValArray, SizeConst=1024)] public Int32[] bmiColors;
}
public delegate void FrameEventHandler(IntPtr lwnd, IntPtr lpVHdr);
// Public methods
public static object GetStructure(IntPtr ptr,ValueType structure)
{
return Marshal.PtrToStructure(ptr,structure.GetType());
}
public static object GetStructure(int ptr,ValueType structure)
{
return GetStructure(new IntPtr(ptr),structure);
}
public static void Copy(IntPtr ptr,byte[] data)
{
Marshal.Copy(ptr,data,0,data.Length);
}
public static void Copy(int ptr,byte[] data)
{
Copy(new IntPtr(ptr),data);
}
public static int SizeOf(object structure)
{
return Marshal.SizeOf(structure);
}
}
}
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Text;
using ConfLib2;
using System.ComponentModel;
namespace RamaSignup
{
public class Config : ConfObject
{
public Config()
{
}
//Username
private string sqlUsername;
[
ConfValueAttribute(1, 32),
Description("Database username"),
Category("Database"),
DefaultValue((string)"vector_ilmo")
]
public string SqlUsername { get { return sqlUsername; } set { sqlUsername = value; } }
//Password
private string sqlPassword;
[
ConfValueAttribute(1, 64),
Description("Database password"),
Category("Database"),
DefaultValue((string)"ramakukka")
]
public string SqlPassword { get { return sqlPassword; } set { sqlPassword = value; } }
private string sqlDatabase;
[
ConfValueAttribute(1, 32),
Description("Database name"),
Category("Database"),
DefaultValue((string)"vector_ilmo_devel")
]
public string SqlDatabase { get { return sqlDatabase; } set { sqlDatabase = value; } }
private string sqlHost;
[
ConfValueAttribute(1, 64),
Description("Database address"),
Category("Database"),
DefaultValue((string)"sql.f-solutions.net")
]
public string SqlHost { get { return sqlHost; } set { sqlHost = value; } }
private int defaultGroup;
[
ConfValueAttribute(0, 65000),
Description("Default group to new player"),
Category("Defaults"),
DefaultValue((int)1)
]
public int DefaultGroup { get { return defaultGroup; } set { defaultGroup = value; } }
}
}
namespace RamaSignup
{
partial class Form1
{
/// <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()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.btnFinnish = new System.Windows.Forms.Button();
this.btnEnglish = new System.Windows.Forms.Button();
this.panel1 = new System.Windows.Forms.Panel();
this.button1 = new System.Windows.Forms.Button();
this.userDetailsEditor1 = new RamaSignup.UserDetailsEditor();
this.userLoginControl1 = new RamaSignup.UserLoginControl();
this.SuspendLayout();
//
// btnFinnish
//
this.btnFinnish.Image = ((System.Drawing.Image)(resources.GetObject("btnFinnish.Image")));
this.btnFinnish.Location = new System.Drawing.Point(784, 14);
this.btnFinnish.Name = "btnFinnish";
this.btnFinnish.Size = new System.Drawing.Size(128, 63);
this.btnFinnish.TabIndex = 80;
this.btnFinnish.UseVisualStyleBackColor = true;
this.btnFinnish.Visible = false;
//
// btnEnglish
//
this.btnEnglish.Image = ((System.Drawing.Image)(resources.GetObject("btnEnglish.Image")));
this.btnEnglish.Location = new System.Drawing.Point(918, 12);
this.btnEnglish.Name = "btnEnglish";
this.btnEnglish.Size = new System.Drawing.Size(128, 65);
this.btnEnglish.TabIndex = 81;
this.btnEnglish.UseVisualStyleBackColor = true;
this.btnEnglish.Visible = false;
//
// panel1
//
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1, 1);
this.panel1.TabIndex = 86;
//
// button1
//
this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.button1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.button1.Location = new System.Drawing.Point(1046, 758);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(10, 10);
this.button1.TabIndex = 95;
this.button1.TabStop = false;
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// userDetailsEditor1
//
this.userDetailsEditor1.BackColor = System.Drawing.Color.Transparent;
this.userDetailsEditor1.Location = new System.Drawing.Point(3, 83);
this.userDetailsEditor1.Name = "userDetailsEditor1";
this.userDetailsEditor1.Size = new System.Drawing.Size(1043, 673);
this.userDetailsEditor1.TabIndex = 98;
this.userDetailsEditor1.Visible = false;
this.userDetailsEditor1.CloseView += new System.EventHandler(this.userDetailsEditor1_CloseView);
this.userDetailsEditor1.Load += new System.EventHandler(this.userDetailsEditor1_Load);
//
// userLoginControl1
//
this.userLoginControl1.BackColor = System.Drawing.Color.Transparent;
this.userLoginControl1.Location = new System.Drawing.Point(340, 222);
this.userLoginControl1.Name = "userLoginControl1";
this.userLoginControl1.Size = new System.Drawing.Size(507, 174);
this.userLoginControl1.TabIndex = 97;
this.userLoginControl1.LoginOk += new System.EventHandler(this.userLoginControl1_LoginOk);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackgroundImage = global::RamaSignup.Properties.Resources.vecto_tausta;
this.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Stretch;
this.ClientSize = new System.Drawing.Size(1058, 768);
this.Controls.Add(this.userDetailsEditor1);
this.Controls.Add(this.userLoginControl1);
this.Controls.Add(this.button1);
this.Controls.Add(this.panel1);
this.Controls.Add(this.btnEnglish);
this.Controls.Add(this.btnFinnish);
this.DoubleBuffered = true;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Name = "Form1";
this.Text = "Form1";
this.WindowState = System.Windows.Forms.FormWindowState.Maximized;
this.Deactivate += new System.EventHandler(this.Form1_Deactivate);
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.Form1_FormClosing);
this.Load += new System.EventHandler(this.Form1_Load);
this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyDown);
this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.Form1_KeyUp);
this.MouseClick += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseClick);
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.Button btnFinnish;
private System.Windows.Forms.Button btnEnglish;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Button button1;
private UserLoginControl userLoginControl1;
private UserDetailsEditor userDetailsEditor1;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using WebCam;
using ImageFilters;
using NpgsqlAltPool;
using DynamicPg;
using Npgsql;
using System.IO;
using MoyaAdminLib;
namespace RamaSignup
{
public partial class Form1 : Form
{
public Form1()
{
RestClient.ApiApplicationKey = Properties.Settings.Default.ApiApplicationKey;
RestClient.ApiPass = Properties.Settings.Default.ApiPass;
RestClient.ApiUser = Properties.Settings.Default.ApiUser;
RestClient.ApiURL = Properties.Settings.Default.ApiURL;
InitializeComponent();
}
enum Language
{
Finnish = 0,
English = 1,
}
// Language currentLanguage = Language.English;
/*
void changed()
{
if (!pictureTaken )
{
this.lblMessage.Text = "Ota kuva ensin painamalla 'Käytä tätä kuvaa' nappia";
this.lblMessage.ForeColor = Color.Red;
this.btnSave.Enabled = false;
return;
}
this.lblMessage.ForeColor = Color.Green;
this.lblMessage.Text = "OK, varmista tietojen oikeellisuus ja tallenna";
this.btnSave.Enabled = true;
}*/
private void Form1_Load(object sender, EventArgs e)
{
if (AutoUpdateLib.AutoUpdateCore.CheckForUpdates(null))
{
Application.ExitThread(); //program is required to close by autoupdate (probably updated)
return;
}
}
bool pictureTaken;
private void btnFinnish_Click(object sender, EventArgs e)
{
}
private void btnEnglish_Click(object sender, EventArgs e)
{
}
bool checkSaveSafety()
{
return true;
}
/*
private void btnSave_Click(object sender, EventArgs e)
{
if (!checkSaveSafety())
{
this.btnSave.Enabled = false;
return;
}
this.Cursor = Cursors.WaitCursor;
this.btnSave.Enabled = false;
this.Enabled = false;
this.btnSave.Refresh();
//savePicture(pid);
MessageBox.Show("Tallennus onnistui.\r\nMene infotiskille, ja kerro heille tämä numero, niin he opastavat sinut eteenpäin.", "Success", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.Enabled = true;
this.Cursor = Cursors.Default;
}*/
bool allowShutdown;
/*
private void txtName_TextChanged(object sender, EventArgs e)
{
changed();
}*/
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
{
if (!allowShutdown)
{
e.Cancel = true;
}
else
{
}
}
private void Form1_Deactivate(object sender, EventArgs e)
{
if (!allowShutdown)
this.Activate();
}
private void Form1_KeyUp(object sender, KeyEventArgs e)
{
if (e.Alt && e.Control && e.KeyCode == Keys.S)
{
allowShutdown = true;
Application.Exit();
return;
}
}
private void Form1_KeyDown(object sender, KeyEventArgs e)
{
if (e.Alt && e.Control && e.KeyCode == Keys.S)
{
allowShutdown = true;
this.Close();
return;
}
}
private void Form1_MouseClick(object sender, MouseEventArgs e)
{
/* if (e.Button == MouseButtons.Right)
{
allowShutdown = true;
Application.Exit();
return;
}*/
}
private void button1_Click(object sender, EventArgs e)
{
allowShutdown = true;
Application.Exit();
}
private void userLoginControl1_LoginOk(object sender, EventArgs e)
{
userLoginControl1.Visible = false;
userDetailsEditor1.LoadUser(userLoginControl1.CurrentUser);
userLoginControl1.Clear();
userDetailsEditor1.Visible = true;
//userLoginControl1.CurrentUser;
}
private void userDetailsEditor1_Load(object sender, EventArgs e)
{
}
private void userDetailsEditor1_CloseView(object sender, EventArgs e)
{
userDetailsEditor1.Visible = false;
userLoginControl1.Visible = true;
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7264F333-9419-4208-AA6D-223D4CE19C05}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>RamaSignup</RootNamespace>
<AssemblyName>RamaSignup</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<RunPostBuildEvent>OnOutputUpdated</RunPostBuildEvent>
<FileUpgradeFlags>
</FileUpgradeFlags>
<OldToolsVersion>3.5</OldToolsVersion>
<UpgradeBackupLocation />
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
<Prefer32Bit>false</Prefer32Bit>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<ItemGroup>
<Reference Include="AutoUpdateLib, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\AutoUpdate\src\AutoPublish\bin\Debug\AutoUpdateLib.dll</HintPath>
</Reference>
<Reference Include="ConfLib2, Version=1.0.1.23606, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Infodesk\res\ConfLib2.dll</HintPath>
</Reference>
<Reference Include="DynamicPg, Version=1.3.7.31629, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Infodesk\res\DynamicPg.dll</HintPath>
</Reference>
<Reference Include="Mono.Security, Version=2.0.0.0, Culture=neutral, PublicKeyToken=0738eb9f132ed756, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Infodesk\res\Mono.Security.dll</HintPath>
</Reference>
<Reference Include="Mono.Security.Protocol.Tls, Version=1.0.1528.33423, Culture=neutral, PublicKeyToken=4c884638a2b03853">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Infodesk\res\Mono.Security.Protocol.Tls.dll</HintPath>
</Reference>
<Reference Include="Npgsql, Version=1.0.0.0, Culture=neutral, PublicKeyToken=5d8b90d52f46fda7, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Infodesk\res\Npgsql.dll</HintPath>
</Reference>
<Reference Include="NpgsqlAltPool, Version=1.4.2.37006, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Infodesk\res\NpgsqlAltPool.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Web.Extensions" />
<Reference Include="System.Xml.Linq">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data.DataSetExtensions">
<RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="API32.cs" />
<Compile Include="Conf.cs" />
<Compile Include="Filters.cs" />
<Compile Include="Form1.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Form1.Designer.cs">
<DependentUpon>Form1.cs</DependentUpon>
</Compile>
<Compile Include="mjpeg\ByteArrayUtils.cs" />
<Compile Include="mjpeg\MJPEGConfiguration.cs" />
<Compile Include="mjpeg\MJPEGSource.cs" />
<Compile Include="mjpeg\MJPEGSourcePage.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="mjpeg\SourceDescriptions.cs" />
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="mjpeg\MJPEGSourcePage.resx">
<DependentUpon>MJPEGSourcePage.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<SubType>Designer</SubType>
</EmbeddedResource>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="TakePictureControl.resx">
<DependentUpon>TakePictureControl.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserDetailsEditor.resx">
<DependentUpon>UserDetailsEditor.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UserLoginControl.resx">
<DependentUpon>UserLoginControl.cs</DependentUpon>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="TakePictureControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="TakePictureControl.Designer.cs">
<DependentUpon>TakePictureControl.cs</DependentUpon>
</Compile>
<Compile Include="TicketType.cs" />
<Compile Include="UserDetailsEditor.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserDetailsEditor.Designer.cs">
<DependentUpon>UserDetailsEditor.cs</DependentUpon>
</Compile>
<Compile Include="UserLoginControl.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="UserLoginControl.Designer.cs">
<DependentUpon>UserLoginControl.cs</DependentUpon>
</Compile>
<Compile Include="Util.cs" />
<Compile Include="videosource\Core.cs" />
<Compile Include="videosource\Events.cs" />
<Compile Include="videosource\IVideoSource.cs" />
<Compile Include="videosource\IVideoSourceDescription.cs" />
<Compile Include="videosource\IVideoSourcePage.cs" />
</ItemGroup>
<ItemGroup>
<None Include="app.config" />
<None Include="vecto_tausta.png" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\MoyaAdminLib.csproj">
<Project>{095ce28f-5b53-4203-85c6-3a9afd486407}</Project>
<Name>MoyaAdminLib</Name>
</ProjectReference>
<ProjectReference Include="..\WebCamWrapper\WebCamWrapper.csproj">
<Project>{cc5d5149-0092-4508-ac34-2abe1468a1c9}</Project>
<Name>WebCamWrapper</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>
</PropertyGroup>
</Project>
\ No newline at end of file

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2013
VisualStudioVersion = 12.0.31101.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaSignup", "MoyaSignup.csproj", "{7264F333-9419-4208-AA6D-223D4CE19C05}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MoyaAdminLib", "..\MoyaAdmin\MoyaAdminUI\MoyaAdminLib\MoyaAdminLib.csproj", "{095CE28F-5B53-4203-85C6-3A9AFD486407}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "WebCamLib", "..\WebCamLib\WebCamLib.vcxproj", "{FD48314A-9615-4BA6-913A-03787FB2DD30}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebCamWrapper", "..\WebCamWrapper\WebCamWrapper.csproj", "{CC5D5149-0092-4508-AC34-2ABE1468A1C9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|Mixed Platforms = Debug|Mixed Platforms
Debug|Win32 = Debug|Win32
Debug|x64 = Debug|x64
Release|Any CPU = Release|Any CPU
Release|Mixed Platforms = Release|Mixed Platforms
Release|Win32 = Release|Win32
Release|x64 = Release|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|Win32.ActiveCfg = Debug|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Debug|x64.ActiveCfg = Debug|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|Any CPU.Build.0 = Release|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|Win32.ActiveCfg = Release|Any CPU
{7264F333-9419-4208-AA6D-223D4CE19C05}.Release|x64.ActiveCfg = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Any CPU.Build.0 = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|Win32.ActiveCfg = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Debug|x64.ActiveCfg = Debug|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Any CPU.ActiveCfg = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Any CPU.Build.0 = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|Win32.ActiveCfg = Release|Any CPU
{095CE28F-5B53-4203-85C6-3A9AFD486407}.Release|x64.ActiveCfg = Release|Any CPU
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|Any CPU.ActiveCfg = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|Mixed Platforms.Build.0 = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|Win32.ActiveCfg = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|Win32.Build.0 = Debug|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|x64.ActiveCfg = Debug|x64
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Debug|x64.Build.0 = Debug|x64
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|Any CPU.ActiveCfg = Release|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|Mixed Platforms.ActiveCfg = Release|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|Mixed Platforms.Build.0 = Release|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|Win32.ActiveCfg = Release|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|Win32.Build.0 = Release|Win32
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|x64.ActiveCfg = Release|x64
{FD48314A-9615-4BA6-913A-03787FB2DD30}.Release|x64.Build.0 = Release|x64
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|Win32.ActiveCfg = Debug|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Debug|x64.ActiveCfg = Debug|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|Any CPU.Build.0 = Release|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|Win32.ActiveCfg = Release|Any CPU
{CC5D5149-0092-4508-AC34-2ABE1468A1C9}.Release|x64.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace RamaSignup
{
static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
System.Reflection.Assembly a = System.Reflection.Assembly.GetExecutingAssembly();
Version appVersion = a.GetName().Version;
string appVersionString = appVersion.ToString();
if (Properties.Settings.Default.ApplicationVersion != appVersion.ToString())
{
Properties.Settings.Default.Upgrade();
Properties.Settings.Default.ApplicationVersion = appVersionString;
}
Application.Run(new Form1());
}
}
}
END
AssemblyInfo.cs
K 25
svn:wc:ra_dav:version-url
V 60
/RamaSignup/!svn/ver/8/RamaSignup/Properties/AssemblyInfo.cs
END
8
dir
7
https://svn.f-solutions.fi/RamaSignup/RamaSignup/Properties
https://svn.f-solutions.fi/RamaSignup
2008-06-12T08:56:20.852145Z
2
keitsi
svn:special svn:externals svn:needs-lock
7bcb2a89-324a-0410-94bb-9424dc35d795
AssemblyInfo.cs
file
8
2009-06-10T23:27:47.828125Z
55908c231febd4737b1bd4b099d66881
2010-02-19T12:46:56.698865Z
8
tapsa
Settings.settings
file
2008-04-06T11:23:25.361250Z
8c0f00d7d9b0046695a0255f1b11b061
2008-04-06T14:06:14.760617Z
1
tapsa
Settings.Designer.cs
file
2008-04-06T11:23:25.455000Z
451950b21d1a94aa3a8f3d556f447c0e
2008-04-06T14:06:14.760617Z
1
tapsa
Resources.resx
file
2008-06-14T00:36:46.203125Z
4c175e52a1bb28441b18470606ffd3a1
2008-06-12T08:56:20.852145Z
2
keitsi
Resources.Designer.cs
file
2008-06-14T00:36:46.203125Z
39abbef49c546afad0784686a9e6dccc
2008-06-12T08:56:20.852145Z
2
keitsi
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RamaSignup")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Oem")]
[assembly: AssemblyProduct("RamaSignup")]
[assembly: AssemblyCopyright("Copyright © Oem 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ed32fc66-2715-4f4d-a408-6161459efc9e")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.5.0")]
[assembly: AssemblyFileVersion("1.0.5.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace RamaSignup.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "2.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RamaSignup.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
internal static System.Drawing.Bitmap vecto_tausta {
get {
object obj = ResourceManager.GetObject("vecto_tausta", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="vecto_tausta" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\vecto_tausta.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.1433
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace RamaSignup.Properties
{
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "9.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
return defaultInstance;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("RamaSignup")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("Oem")]
[assembly: AssemblyProduct("RamaSignup")]
[assembly: AssemblyCopyright("Copyright © Oem 2008")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("ed32fc66-2715-4f4d-a408-6161459efc9e")]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.5.0")]
[assembly: AssemblyFileVersion("1.0.5.0")]
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace RamaSignup.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
// This class was auto-generated by the StronglyTypedResourceBuilder
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("RamaSignup.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set {
resourceCulture = value;
}
}
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
internal static System.Drawing.Bitmap vecto_tausta {
get {
object obj = ResourceManager.GetObject("vecto_tausta", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
}
}
}
}
<?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=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="vecto_tausta" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\vecto_tausta.png;System.Drawing.Bitmap, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
</root>
\ No newline at end of file
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.34209
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace RamaSignup.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default {
get {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("http://10.220.105.252:8080/MoyaWeb")]
public string ApiURL {
get {
return ((string)(this["ApiURL"]));
}
set {
this["ApiURL"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("8krAyTEpzP6QnwzkxGek")]
public string ApiApplicationKey {
get {
return ((string)(this["ApiApplicationKey"]));
}
set {
this["ApiApplicationKey"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("tapsa")]
public string ApiUser {
get {
return ((string)(this["ApiUser"]));
}
set {
this["ApiUser"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("6uGbN6GiQqbZy1n,p3hg")]
public string ApiPass {
get {
return ((string)(this["ApiPass"]));
}
set {
this["ApiPass"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string ApplicationVersion {
get {
return ((string)(this["ApplicationVersion"]));
}
set {
this["ApplicationVersion"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string Port {
get {
return ((string)(this["Port"]));
}
set {
this["Port"] = value;
}
}
}
}
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="RamaSignup.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="ApiURL" Type="System.String" Scope="User">
<Value Profile="(Default)">http://10.220.105.252:8080/MoyaWeb</Value>
</Setting>
<Setting Name="ApiApplicationKey" Type="System.String" Scope="User">
<Value Profile="(Default)">8krAyTEpzP6QnwzkxGek</Value>
</Setting>
<Setting Name="ApiUser" Type="System.String" Scope="User">
<Value Profile="(Default)">tapsa</Value>
</Setting>
<Setting Name="ApiPass" Type="System.String" Scope="User">
<Value Profile="(Default)">6uGbN6GiQqbZy1n,p3hg</Value>
</Setting>
<Setting Name="ApplicationVersion" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="Port" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
namespace RamaSignup
{
partial class TakePictureControl
{
/// <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 Component 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.pbIncoming = new System.Windows.Forms.PictureBox();
this.btnTakePic = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pbIncoming)).BeginInit();
this.SuspendLayout();
//
// pbIncoming
//
this.pbIncoming.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pbIncoming.Location = new System.Drawing.Point(3, 3);
this.pbIncoming.Name = "pbIncoming";
this.pbIncoming.Size = new System.Drawing.Size(299, 411);
this.pbIncoming.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pbIncoming.TabIndex = 119;
this.pbIncoming.TabStop = false;
//
// btnTakePic
//
this.btnTakePic.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnTakePic.Location = new System.Drawing.Point(3, 419);
this.btnTakePic.Name = "btnTakePic";
this.btnTakePic.Size = new System.Drawing.Size(299, 36);
this.btnTakePic.TabIndex = 120;
this.btnTakePic.Text = "Ota uusi kuva";
this.btnTakePic.UseVisualStyleBackColor = true;
this.btnTakePic.Click += new System.EventHandler(this.btnTakePic_Click_1);
//
// TakePictureControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.btnTakePic);
this.Controls.Add(this.pbIncoming);
this.Name = "TakePictureControl";
this.Size = new System.Drawing.Size(306, 461);
this.VisibleChanged += new System.EventHandler(this.TakePictureControl_VisibleChanged);
((System.ComponentModel.ISupportInitialize)(this.pbIncoming)).EndInit();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.PictureBox pbIncoming;
private System.Windows.Forms.Button btnTakePic;
}
}
<?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
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RamaSignup
{
class TicketType
{
public int Id;
public string Description;
public TicketType(int id, string description)
{
this.Id = id;
this.Description = description;
}
public override string ToString()
{
return this.Description;
}
}
}
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type='text/xsl' href='_UpgradeReport_Files/UpgradeReport.xslt'?><UpgradeLog>
<Properties><Property Name="Solution" Value="RamaSignup">
</Property><Property Name="Solution File" Value="D:\Devel\proj\moya-info-tools\MoyaSignup\RamaSignup.sln">
</Property><Property Name="Date" Value="6. kesäkuuta 2014">
</Property><Property Name="Time" Value="18:56">
</Property></Properties><Event ErrorLevel="0" Project="RamaSignup" Source="RamaSignup.csproj" Description="Project converted successfully">
</Event><Event ErrorLevel="3" Project="RamaSignup" Source="RamaSignup.csproj" Description="Converted">
</Event><Event ErrorLevel="0" Project="" Source="RamaSignup.sln" Description="Solution converted successfully">
</Event><Event ErrorLevel="3" Project="" Source="RamaSignup.sln" Description="Converted">
</Event><Event ErrorLevel="0" Project="RamaSignup" Source="RamaSignup.csproj" Description="Scan complete: Upgrade not required for project files.">
</Event></UpgradeLog>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MoyaAdminLib;
using System.Globalization;
using System.Net;
using System.IO;
namespace RamaSignup
{
public partial class UserDetailsEditor : UserControl
{
public event EventHandler CloseView;
User currentUser = null;
public UserDetailsEditor()
{
InitializeComponent();
cbGender.Items.Add("Valitse");
cbGender.Items.Add("Mies");
cbGender.Items.Add("Nainen");
}
public void LoadUser(User user)
{
btnSaveData.Visible = false;
txtEmail.Text = user.Email;
txtFirstName.Text = user.Firstname;
txtLastName.Text = user.Lastname;
txtNick.Text = user.Nick;
//takePictureControl1.loadUserImage(user);
txtAdress.Text = user.StreetAddress;
txtZip.Text = user.ZipCode;
txtCity.Text = user.postOffice;
txtPhone.Text = user.PhoneNumber;
DateTime birthday = DateTime.MinValue;
DateTime.TryParse(user.Birthday, out birthday);
if (user.Gender == "MALE")
cbGender.SelectedItem = "Mies";
else if (user.Gender == "FEMALE")
cbGender.SelectedItem = "Nainen";
else
cbGender.SelectedItem = "Valitse";
//txtAge.Text = user.Birthday;
if (user.UserId == 0)
{
// new user
takePictureControl1.TakePicture();
txtFirstName.ReadOnly = false;
txtLastName.ReadOnly = false;
txtNick.ReadOnly = false;
txtAdress.ReadOnly = false;
txtZip.ReadOnly = false;
txtCity.ReadOnly = false;
txtPhone.ReadOnly = false;
}
else
{
// old user
takePictureControl1.loadUserImage(user);
}
currentUser = user;
lblMessage.Text = "Voit pyytää muutoksia tietoihin infotiskillä";
}
void clear()
{
this.cbGender.SelectedIndex = 0;
txtAdress.Text = "";
//txtAge.Text = "";
txtCity.Text = "";
txtEmail.Text = "";
txtFirstName.Text = "";
txtNick.Text = "";
txtPhone.Text = "";
txtZip.Text = "";
currentUser = null;
}
void checkFields()
{
string errorType = getErrorMessage();
if (errorType != null)
{
this.lblMessage.Text = errorType + " puuttuu tai on virheellinen. Täytä puuttuvat kentät oikeilla tiedoilla.";
this.lblMessage.ForeColor = Color.Red;
return;
}
}
string getErrorMessage()
{
int tmp;
//checking validity
if (this.txtFirstName.Text.Trim().Length < 5)
{
return "Nimi";
}
else if (this.txtNick.Text.Trim().Length < 2)
{
return "Nick (nimimerkki)";
}
/*else if (this.txtAge.Text.Trim().Length < 1 || (!int.TryParse(this.txtAge.Text.Trim(), out tmp)))
{
return "Syntymäaika";
}*/
else if (this.cbGender.SelectedIndex == 0)
{
return "Sukupuoli";
}
else if (this.txtPhone.Text.Length < 2)
{
return "Puhelinnumero";
}
else if (this.txtEmail.Text.Trim().Length < 5)
{
return "Sähköposti";
}
else if (this.txtAdress.Text.Trim().Length < 2)
{
return "Lähiosoite";
}
else if (this.txtZip.Text.Trim().Length != 5 || (!int.TryParse(this.txtZip.Text.Trim(), out tmp)))
{
return "Postinumero";
}
else if (this.txtCity.Text.Trim().Length < 2)
{
return "Paikkakunta";
}
else
{
return null;
}
}
private void UserDetailsEditor_Load(object sender, EventArgs e)
{
lblMessage.Text = "";
takePictureControl1.Changed += takePictureControl1_Changed;
}
void takePictureControl1_Changed(object sender, EventArgs e)
{
btnSaveData.Visible = true;
}
private void btnSaveData_Click(object sender, EventArgs e)
{
if (currentUser.UserId > 0)
takePictureControl1.SaveUserImage(currentUser);
else
{
}
onCloseView();
}
private void btnCancel_Click(object sender, EventArgs e)
{
onCloseView();
}
private void onCloseView()
{
clear();
if (CloseView != null)
CloseView(this, null);
}
}
}
<?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
{
partial class UserLoginControl
{
/// <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 Component 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.components = new System.ComponentModel.Container();
this.label4 = new System.Windows.Forms.Label();
this.txtEmail = new System.Windows.Forms.TextBox();
this.timer1 = new System.Windows.Forms.Timer(this.components);
this.infoLabel = new System.Windows.Forms.Label();
this.passwordTextBox = new System.Windows.Forms.TextBox();
this.loginButton = new System.Windows.Forms.Button();
this.forgottenPasswordButton = new System.Windows.Forms.Button();
this.btnNewProfile = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// label4
//
this.label4.AutoSize = true;
this.label4.BackColor = System.Drawing.Color.Transparent;
this.label4.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label4.Location = new System.Drawing.Point(13, 12);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(52, 16);
this.label4.TabIndex = 68;
this.label4.Text = "E-Mail";
this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
//
// txtEmail
//
this.txtEmail.BackColor = System.Drawing.SystemColors.Window;
this.txtEmail.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtEmail.Location = new System.Drawing.Point(16, 31);
this.txtEmail.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.txtEmail.Name = "txtEmail";
this.txtEmail.Size = new System.Drawing.Size(395, 26);
this.txtEmail.TabIndex = 67;
this.txtEmail.TextChanged += new System.EventHandler(this.txtEmail_TextChanged);
//
// timer1
//
this.timer1.Interval = 500;
this.timer1.Tick += new System.EventHandler(this.timer1_Tick);
//
// infoLabel
//
this.infoLabel.AutoSize = true;
this.infoLabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 9.75F, System.Drawing.FontStyle.Bold);
this.infoLabel.Location = new System.Drawing.Point(13, 67);
this.infoLabel.Name = "infoLabel";
this.infoLabel.Size = new System.Drawing.Size(12, 16);
this.infoLabel.TabIndex = 69;
this.infoLabel.Text = " ";
//
// passwordTextBox
//
this.passwordTextBox.BackColor = System.Drawing.SystemColors.Window;
this.passwordTextBox.Font = new System.Drawing.Font("Microsoft Sans Serif", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.passwordTextBox.Location = new System.Drawing.Point(16, 86);
this.passwordTextBox.Margin = new System.Windows.Forms.Padding(3, 3, 3, 10);
this.passwordTextBox.Name = "passwordTextBox";
this.passwordTextBox.PasswordChar = '*';
this.passwordTextBox.Size = new System.Drawing.Size(125, 26);
this.passwordTextBox.TabIndex = 93;
this.passwordTextBox.Visible = false;
this.passwordTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.passwordTextBox_KeyDown);
//
// loginButton
//
this.loginButton.Location = new System.Drawing.Point(148, 86);
this.loginButton.Name = "loginButton";
this.loginButton.Size = new System.Drawing.Size(118, 26);
this.loginButton.TabIndex = 94;
this.loginButton.Text = "Kirjaudu tapahtumaan";
this.loginButton.UseVisualStyleBackColor = true;
this.loginButton.Visible = false;
this.loginButton.Click += new System.EventHandler(this.loginButton_Click);
//
// forgottenPasswordButton
//
this.forgottenPasswordButton.Location = new System.Drawing.Point(272, 86);
this.forgottenPasswordButton.Name = "forgottenPasswordButton";
this.forgottenPasswordButton.Size = new System.Drawing.Size(139, 26);
this.forgottenPasswordButton.TabIndex = 95;
this.forgottenPasswordButton.Text = "En muista salasanaani";
this.forgottenPasswordButton.UseVisualStyleBackColor = true;
this.forgottenPasswordButton.Visible = false;
//
// btnNewProfile
//
this.btnNewProfile.Location = new System.Drawing.Point(16, 86);
this.btnNewProfile.Name = "btnNewProfile";
this.btnNewProfile.Size = new System.Drawing.Size(126, 26);
this.btnNewProfile.TabIndex = 96;
this.btnNewProfile.Text = "Lisää omat tiedot";
this.btnNewProfile.UseVisualStyleBackColor = true;
this.btnNewProfile.Visible = false;
this.btnNewProfile.Click += new System.EventHandler(this.btnNewProfile_Click);
//
// UserLoginControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.btnNewProfile);
this.Controls.Add(this.forgottenPasswordButton);
this.Controls.Add(this.loginButton);
this.Controls.Add(this.passwordTextBox);
this.Controls.Add(this.infoLabel);
this.Controls.Add(this.label4);
this.Controls.Add(this.txtEmail);
this.Name = "UserLoginControl";
this.Size = new System.Drawing.Size(420, 126);
this.Load += new System.EventHandler(this.UserLoginControl_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label4;
private System.Windows.Forms.TextBox txtEmail;
private System.Windows.Forms.Timer timer1;
private System.Windows.Forms.Label infoLabel;
private System.Windows.Forms.TextBox passwordTextBox;
private System.Windows.Forms.Button loginButton;
private System.Windows.Forms.Button forgottenPasswordButton;
private System.Windows.Forms.Button btnNewProfile;
}
}
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using MoyaAdminLib;
using System.Web.Script.Serialization;
using System.Net;
namespace RamaSignup
{
public partial class UserLoginControl : UserControl
{
public event EventHandler LoginOk;
public UserLoginControl()
{
InitializeComponent();
SetStyle(ControlStyles.SupportsTransparentBackColor, true);
this.BackColor = Color.Transparent;
infoLabel.Text = "Hei! Kirjoita sähköpostiosoitteesi";
}
private void UserLoginControl_Load(object sender, EventArgs e)
{
}
private void txtEmail_TextChanged(object sender, EventArgs e)
{
string txt = txtEmail.Text;
if (IsValidEmail(txt))
{
timer1.Stop();
timer1.Start();
}
else
{
timer1.Stop();
CurrentUser = null;
btnNewProfile.Visible = false;
infoLabel.Text = "Hei! Kirjoita sähköpostiosoitteesi";
}
}
bool IsValidEmail(string email)
{
if (!email.Contains("@") || !email.Contains("."))
return false;
string[] parts = email.Split(new string[] { "@" }, StringSplitOptions.RemoveEmptyEntries);
if (parts.Count<string>() == 2)
{
if (!parts[1].Contains("."))
return false;
string[] domainparts = parts[1].Split(new string[] { "." }, StringSplitOptions.RemoveEmptyEntries);
if (domainparts.Count<string>() < 2)
return false;
string ltd = domainparts[domainparts.Count<string>() - 1];
if (ltd.Length < 2)
return false;
}
else return false;
try
{
var addr = new System.Net.Mail.MailAddress(email);
return addr.Address == email;
}
catch
{
return false;
}
}
public User CurrentUser;
private void timer1_Tick(object sender, EventArgs e)
{
RestClient client = new RestClient();
try
{
string json = client.MakeRequest("user", "email=" + txtEmail.Text);
JavaScriptSerializer ser = new JavaScriptSerializer();
Eventuser euser = ser.Deserialize<Eventuser>(json);
if (euser != null)
{
btnNewProfile.Visible = false;
CurrentUser = new User(euser);
infoLabel.Text = "Hei! " + CurrentUser.ToString() + " Kirjoita salasanasi ja kirjaudu";
showLogin(true);
}
}
catch (Exception ex)
{
CurrentUser = null;
infoLabel.Text = "Uusi kävijä?";
btnNewProfile.Visible = true;
showLogin(false);
}
timer1.Stop();
}
void showLogin(bool show)
{
passwordTextBox.Visible = show;
loginButton.Visible = show;
}
private void login()
{
RestClient client;
client = new RestClient(RestClient.ApiURL, HttpVerb.POST);
//client.PostData = "password=" + WebUtility.UrlEncode(passwordTextBox.Text);
client.PostData = "password=" + passwordTextBox.Text;
client.ContentType = "application/x-www-form-urlencoded";
try
{
string json = client.MakeRequest("v2/user/" + CurrentUser.UserId + "/check-password");
//string json2 = client.MakeRequest("user/"+ CurrentUser.UserId +"/check-password");
///MoyaWeb/rest/user/eventusers
JavaScriptSerializer ser = new JavaScriptSerializer();
Eventuser euser = ser.Deserialize<Eventuser>(json);
if (euser != null)
{
CurrentUser = new User(euser);
CurrentUser.Email = txtEmail.Text;
if (LoginOk != null)
LoginOk(this, null);
}
else
wrongPass();
}
catch (Exception ex)
{
wrongPass();
}
}
private void loginButton_Click(object sender, EventArgs e)
{
login();
}
private void wrongPass()
{
infoLabel.Text = "Väärä salasana. Syötä salasana uudelleen";
}
private void passwordTextBox_KeyDown(object sender, KeyEventArgs e)
{
if (e.KeyData == Keys.Enter)
login();
}
private void btnNewProfile_Click(object sender, EventArgs e)
{
CurrentUser = new User();
CurrentUser.Email = txtEmail.Text;
//Send info to parent control
if (LoginOk != null)
LoginOk(this, null);
}
internal void Clear()
{
CurrentUser = null;
txtEmail.Text = "";
passwordTextBox.Text = "";
}
}
}
<?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>
<metadata name="timer1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root>
\ No newline at end of file
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace RamaSignup
{
public static class Util
{
/// <summary>
/// Escapes SQL special characters from string using \
/// effectively preventing SQL injections.
/// </summary>
/// <param name="stringToEscape"></param>
/// <returns></returns>
public static string Esc(string stringToEscape)
{
return stringToEscape.Replace(@"\", @"\\").Replace("'", @"\'");
}
}
}
BODY
{
BACKGROUND-COLOR: white;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px
}
P
{
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 70%;
LINE-HEIGHT: 12pt;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 10px
}
.note
{
BACKGROUND-COLOR: #ffffff;
COLOR: #336699;
FONT-FAMILY: "Verdana", sans-serif;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 0px;
MARGIN-LEFT: 0px;
MARGIN-TOP: 0px;
PADDING-RIGHT: 10px
}
.infotable
{
BACKGROUND-COLOR: #f0f0e0;
BORDER-BOTTOM: #ffffff 0px solid;
BORDER-COLLAPSE: collapse;
BORDER-LEFT: #ffffff 0px solid;
BORDER-RIGHT: #ffffff 0px solid;
BORDER-TOP: #ffffff 0px solid;
FONT-SIZE: 70%;
MARGIN-LEFT: 10px
}
.issuetable
{
BACKGROUND-COLOR: #ffffe8;
BORDER-COLLAPSE: collapse;
COLOR: #000000;
FONT-SIZE: 100%;
MARGIN-BOTTOM: 10px;
MARGIN-LEFT: 13px;
MARGIN-TOP: 0px
}
.issuetitle
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px;
COLOR: #003366;
FONT-WEIGHT: normal
}
.header
{
BACKGROUND-COLOR: #cecf9c;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
COLOR: #000000;
FONT-WEIGHT: bold
}
.issuehdr
{
BACKGROUND-COLOR: #E0EBF5;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
COLOR: #000000;
FONT-WEIGHT: normal
}
.issuenone
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: 0px;
BORDER-LEFT: 0px;
BORDER-RIGHT: 0px;
BORDER-TOP: 0px;
COLOR: #000000;
FONT-WEIGHT: normal
}
.content
{
BACKGROUND-COLOR: #e7e7ce;
BORDER-BOTTOM: #ffffff 1px solid;
BORDER-LEFT: #ffffff 1px solid;
BORDER-RIGHT: #ffffff 1px solid;
BORDER-TOP: #ffffff 1px solid;
PADDING-LEFT: 3px
}
.issuecontent
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #dcdcdc 1px solid;
BORDER-TOP: #dcdcdc 1px solid;
PADDING-LEFT: 3px
}
A:link
{
COLOR: #cc6633;
TEXT-DECORATION: underline
}
A:visited
{
COLOR: #cc6633;
}
A:active
{
COLOR: #cc6633;
}
A:hover
{
COLOR: #cc3300;
TEXT-DECORATION: underline
}
H1
{
BACKGROUND-COLOR: #003366;
BORDER-BOTTOM: #336699 6px solid;
COLOR: #ffffff;
FONT-SIZE: 130%;
FONT-WEIGHT: normal;
MARGIN: 0em 0em 0em -20px;
PADDING-BOTTOM: 8px;
PADDING-LEFT: 30px;
PADDING-TOP: 16px
}
H2
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 3px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px;
PADDING-LEFT: 0px
}
H3
{
COLOR: #000000;
FONT-SIZE: 80%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: -5px;
MARGIN-LEFT: 10px;
MARGIN-TOP: 20px
}
H4
{
COLOR: #000000;
FONT-SIZE: 70%;
FONT-WEIGHT: bold;
MARGIN-BOTTOM: 0px;
MARGIN-TOP: 15px;
PADDING-BOTTOM: 0px
}
UL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
OL
{
COLOR: #000000;
FONT-SIZE: 70%;
LIST-STYLE: square;
MARGIN-BOTTOM: 0pt;
MARGIN-TOP: 0pt
}
LI
{
LIST-STYLE: square;
MARGIN-LEFT: 0px
}
.expandable
{
CURSOR: hand
}
.expanded
{
color: black
}
.collapsed
{
DISPLAY: none
}
.foot
{
BACKGROUND-COLOR: #ffffff;
BORDER-BOTTOM: #cecf9c 1px solid;
BORDER-TOP: #cecf9c 2px solid
}
.settings
{
MARGIN-LEFT: 25PX;
}
.help
{
TEXT-ALIGN: right;
margin-right: 10px;
}
<?xml version="1.0"?>
<configuration>
<configSections>
<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"/>
</sectionGroup>
</configSections>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Npgsql" publicKeyToken="5D8B90D52F46FDA7" culture="neutral"/>
<bindingRedirect oldVersion="0.0.0.0-1.0.0.0" newVersion="1.0.0.0"/>
</dependentAssembly>
</assemblyBinding>
</runtime>
<userSettings>
<RamaSignup.Properties.Settings>
<setting name="ApiURL" serializeAs="String">
<value>http://10.220.105.252:8080/MoyaWeb</value>
</setting>
<setting name="ApiApplicationKey" serializeAs="String">
<value>8krAyTEpzP6QnwzkxGek</value>
</setting>
<setting name="ApiUser" serializeAs="String">
<value>tapsa</value>
</setting>
<setting name="ApiPass" serializeAs="String">
<value>6uGbN6GiQqbZy1n,p3hg</value>
</setting>
<setting name="ApplicationVersion" serializeAs="String">
<value />
</setting>
<setting name="Port" serializeAs="String">
<value />
</setting>
</RamaSignup.Properties.Settings>
</userSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<?xml version="1.0" encoding="utf-8"?>
<AutoPublishSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<UploadUser>f-solu-06</UploadUser>
<UploadPath>/home/f-solu-06/software.f-solutions.fi</UploadPath>
<UploadHost>software.f-solutions.fi</UploadHost>
<ProjectName>RamaSignup</ProjectName>
<Customers>
<Customer>
<Name>vectorama</Name>
<Password>ramakukka</Password>
<AllowDevelopmentReleases>false</AllowDevelopmentReleases>
</Customer>
</Customers>
<ForceUpdate>false</ForceUpdate>
</AutoPublishSettings>
\ No newline at end of file
-----BEGIN CERTIFICATE-----
MIIECDCCA3GgAwIBAgICJBwwDQYJKoZIhvcNAQEFBQAwgbkxCzAJBgNVBAYTAi0t
MRIwEAYDVQQIEwlTb21lU3RhdGUxETAPBgNVBAcTCFNvbWVDaXR5MRkwFwYDVQQK
ExBTb21lT3JnYW5pemF0aW9uMR8wHQYDVQQLExZTb21lT3JnYW5pemF0aW9uYWxV
bml0MR0wGwYDVQQDExR3d3cuYWRtaW5pc3RyYXRvci5maTEoMCYGCSqGSIb3DQEJ
ARYZcm9vdEB3d3cuYWRtaW5pc3RyYXRvci5maTAeFw0wODAyMDIxOTQ0MjNaFw0w
OTAyMDExOTQ0MjNaMIG5MQswCQYDVQQGEwItLTESMBAGA1UECBMJU29tZVN0YXRl
MREwDwYDVQQHEwhTb21lQ2l0eTEZMBcGA1UEChMQU29tZU9yZ2FuaXphdGlvbjEf
MB0GA1UECxMWU29tZU9yZ2FuaXphdGlvbmFsVW5pdDEdMBsGA1UEAxMUd3d3LmFk
bWluaXN0cmF0b3IuZmkxKDAmBgkqhkiG9w0BCQEWGXJvb3RAd3d3LmFkbWluaXN0
cmF0b3IuZmkwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBALyTeTE1MCV7aIQF
eIw18c488OcjUh3WEUd9Nv7opg1Kkjd48YPPgbsrm/uqLITPOX+ftavJbcYYutbH
xcRET+9ZzbA/icqGSDXV4RW78w7mDrB9E6lXPaPwTYXt7EnjfJAZUjcCfTmHQ3jC
lsQELGY/my1b4Xqdpzlb2nCIXWyRAgMBAAGjggEbMIIBFzAdBgNVHQ4EFgQUqmur
HuSCOnltZ760q3QHTnU+rdkwgecGA1UdIwSB3zCB3IAUqmurHuSCOnltZ760q3QH
TnU+rdmhgb+kgbwwgbkxCzAJBgNVBAYTAi0tMRIwEAYDVQQIEwlTb21lU3RhdGUx
ETAPBgNVBAcTCFNvbWVDaXR5MRkwFwYDVQQKExBTb21lT3JnYW5pemF0aW9uMR8w
HQYDVQQLExZTb21lT3JnYW5pemF0aW9uYWxVbml0MR0wGwYDVQQDExR3d3cuYWRt
aW5pc3RyYXRvci5maTEoMCYGCSqGSIb3DQEJARYZcm9vdEB3d3cuYWRtaW5pc3Ry
YXRvci5maYICJBwwDAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQUFAAOBgQCOuL+x
zuyL3RlS5Mrkerew/RoPgl9zwIt8wHc2X0Ra+0ZcYGysCicLo/3e+AA8ksUTVZjc
F9MAWQ0VcAbPVEFwKfdpWU0NdmhxpHBZX8kpn1NfR1HtS7TfRoBJ+M+RqliHgTJj
6DAdaE3br/LcDnf2eRZh8b3plR1FunU8dYRZiQ==
-----END CERTIFICATE-----
; NSIS script - ONLY for use with AutoPublish/AutoUpdate system
; //keitsi
;--------------------------------
;Include Modern UI
!include "MUI.nsh"
;--------------------------------
;Configuration
SetCompressor lzma
Name "<$PROJECTNAME$> v<$VERSION$> <$CUSTOMER$>"
; DO NOT CHANGE OutFile "installer_temp.exe" !!! AutoPublish requires this.
; AutoPublish will move the installer according to autopublish.xml file.
OutFile "installer_temp.exe"
;Folder selection page
InstallDir "$PROGRAMFILES\<$PROJECTNAME$>"
;Get install folder from registry if available
InstallDirRegKey HKCU "Software\<$PROJECTNAME$>" ""
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Pages
; !insertmacro MUI_PAGE_LICENSE "license.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
; !define MUI_FINISHPAGE_RUN $INSTDIR\<$BINARYNAME$>
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Function GetDotNet
IfFileExists "$WINDIR\Microsoft.NET\Framework\v2.0.50727\installUtil.exe" NextStep
MessageBox MB_OK|MB_ICONEXCLAMATION "You must have the Microsoft .NET Framework 2.0 Installed to use this application. $\n$\nClick 'Open' in the following file dialog to download and run the Microsoft .NET Framework Installer..."
ExecShell Open "http://www.microsoft.com/downloads/info.aspx?na=90&p=&SrcDisplayLang=en&SrcCategoryId=&SrcFamilyId=0856eacb-4362-4b0d-8edd-aab15c5e04f5&u=http%3a%2f%2fdownload.microsoft.com%2fdownload%2f5%2f6%2f7%2f567758a3-759e-473e-bf8f-52154438565a%2fdotnetfx.exe" SW_SHOWNORMAL
Quit
NextStep:
FunctionEnd
Function .onInit
Call GetDotNet
FunctionEnd
Function .onInstSuccess
Exec '"$INSTDIR\<$BINARYNAME$>"'
FunctionEnd
Function WaitProgramClose
IfFileExists "$INSTDIR\<$BINARYNAME$>" loop NotInstalled
loop:
ClearErrors
Delete "$INSTDIR\<$BINARYNAME$>"
${If} ${Errors}
; Delete failed - means the program is still running. Sleep 2 seconds and retry.
Sleep 2000
ClearErrors
Delete "$INSTDIR\<$BINARYNAME$>"
${If} ${Errors}
MessageBox MB_OK "Program <$BINARYNAME$> didn't close in 2 seconds. Automatic update can't continue before it's closed. Please close the program manually and hit OK to retry."
goto loop
${EndIf}
${EndIf}
NotInstalled:
FunctionEnd
Section "!<$PROJECTNAME$> v<$VERSION$>" SecMain
SetOutPath "$INSTDIR"
Call WaitProgramClose
SetOverwrite off
File /oname=ramasignup.conf "<$BINARYDIR$>\ramasignup.conf"
SetOverwrite on
File /oname=autoupdate.xml "<$BINARYDIR$>\autoupdate.<$CUSTOMER$>.xml"
File /oname=<$BINARYNAME$> "<$BINARYDIR$>\<$BINARYNAME$>"
File /oname=RamaSignup.pdb "<$BINARYDIR$>\RamaSignup.pdb"
; File /oname=Npgsql.pdb "<$BINARYDIR$>\Npgsql.pdb"
; File /oname=NpgsqlAltPool.pdb "<$BINARYDIR$>\NpgsqlAltPool.pdb"
File /oname=AutoUpdateLib.pdb "<$BINARYDIR$>\AutoUpdateLib.pdb"
; File /oname=ConfLibSql.pdb "<$BINARYDIR$>\ConfLibSql.pdb"
File autoupdate.crt
;File "..\..\res\speexenc.exe"
; File "<$BINARYDIR$>\logo.jpg"
; this line will be replicated for every non-default existing assembly
; that is referenced to the main project.
File "<$REFERENCEDASSEMBLY$>"
WriteRegStr HKCU "Software\<$PROJECTNAME$>" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
;Create shortcuts
CreateDirectory "$SMPROGRAMS\<$PROJECTNAME$>"
CreateShortCut "$SMPROGRAMS\<$PROJECTNAME$>\<$PROJECTNAME$>.lnk" "$INSTDIR\<$BINARYNAME$>"
CreateShortCut "$SMPROGRAMS\<$PROJECTNAME$>\Uninstall <$PROJECTNAME$>.lnk" "$INSTDIR\Uninstall.exe"
SectionEnd
;--------------------------------
;Descriptions
LangString DESC_SecMain ${LANG_ENGLISH} "Base (required)"
;--------------------------------
;Uninstaller Section
Section "Uninstall"
Delete "$SMPROGRAMS\<$PROJECTNAME$>\*"
RMDir "$SMPROGRAMS\<$PROJECTNAME$>"
Delete "$INSTDIR\<$BINARYNAME$>"
Delete "$INSTDIR\autoupdate.xml"
Delete "$INSTDIR\autoupdate.crt"
Delete "$INSTDIR\speexenc.exe"
; this line will be replicated for every non-default existing assembly
; that is referenced to the main project.
Delete "$INSTDIR\<$REFERENCEDASSEMBLY$>"
Delete "$INSTDIR\Uninstall.exe"
RMDir "$INSTDIR"
SectionEnd
\ No newline at end of file
8
dir
7
https://svn.f-solutions.fi/RamaSignup/RamaSignup/deps
https://svn.f-solutions.fi/RamaSignup
2008-06-12T08:56:20.852145Z
2
keitsi
svn:special svn:externals svn:needs-lock
7bcb2a89-324a-0410-94bb-9424dc35d795
DynamicPg.dll
file
2008-06-14T00:36:46.109375Z
70c8ed9f13c2298fbb1a55055a4e1a98
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
ConfLib2.dll
file
2008-06-14T00:36:46.125000Z
9c025bed10d8fc02b2b0329d827bfd6d
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
Mono.Security.dll
file
2008-06-14T00:36:46.125000Z
9644e30721a868e46a1e24330e05590c
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
Mono.Security.Protocol.Tls.dll
file
2008-06-14T00:36:46.140625Z
ef109ed9172ec910ab4af2a88e200f0b
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
NpgsqlAltPool.dll
file
2008-06-14T00:36:46.140625Z
3dedecb6c4267a4ed7ea860d1edc5444
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
SQLTools.dll
file
2008-06-14T00:36:46.140625Z
b07a308c2ea222c2f168cf1a940dea53
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
old
dir
Npgsql.dll
file
2008-06-14T00:36:46.140625Z
2713b75d74f0abf6edcd14d7442cd12e
2008-06-12T08:56:20.852145Z
2
keitsi
has-props
K 13
svn:mime-type
V 24
application/octet-stream
END
K 13
svn:mime-type
V 24
application/octet-stream
END
K 13
svn:mime-type
V 24
application/octet-stream
END
K 13
svn:mime-type
V 24
application/octet-stream
END
K 13
svn:mime-type
V 24
application/octet-stream
END
K 13
svn:mime-type
V 24
application/octet-stream
END
K 13
svn:mime-type
V 24
application/octet-stream
END
8
dir
7
https://svn.f-solutions.fi/RamaSignup/RamaSignup/deps/old
https://svn.f-solutions.fi/RamaSignup
2008-06-12T08:56:20.852145Z
2
keitsi
svn:special svn:externals svn:needs-lock
7bcb2a89-324a-0410-94bb-9424dc35d795
K 25
svn:wc:ra_dav:version-url
V 39
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg
END
MJPEGSourcePage.resx
K 25
svn:wc:ra_dav:version-url
V 60
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg/MJPEGSourcePage.resx
END
MJPEGSourcePage.cs
K 25
svn:wc:ra_dav:version-url
V 58
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg/MJPEGSourcePage.cs
END
ByteArrayUtils.cs
K 25
svn:wc:ra_dav:version-url
V 57
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg/ByteArrayUtils.cs
END
MJPEGSource.cs
K 25
svn:wc:ra_dav:version-url
V 54
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg/MJPEGSource.cs
END
SourceDescriptions.cs
K 25
svn:wc:ra_dav:version-url
V 61
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg/SourceDescriptions.cs
END
MJPEGConfiguration.cs
K 25
svn:wc:ra_dav:version-url
V 61
/RamaSignup/!svn/ver/8/RamaSignup/mjpeg/MJPEGConfiguration.cs
END
8
dir
8
https://svn.f-solutions.fi/RamaSignup/RamaSignup/mjpeg
https://svn.f-solutions.fi/RamaSignup
2010-02-19T12:46:56.698865Z
8
tapsa
svn:special svn:externals svn:needs-lock
MJPEGSourcePage.resx
file
2005-03-08T09:43:58.000000Z
77691a6c212340829b2b3342d4b24161
2010-02-19T12:46:56.698865Z
8
tapsa
MJPEGSourcePage.cs
file
2006-10-09T19:24:56.000000Z
1781a147ed0503b3ff170e6ec3b8699d
2010-02-19T12:46:56.698865Z
8
tapsa
ByteArrayUtils.cs
file
2006-10-09T19:24:56.000000Z
12d0eaacb21f4564785a5413d2cbe4f8
2010-02-19T12:46:56.698865Z
8
tapsa
MJPEGSource.cs
file
2006-10-09T19:24:56.000000Z
6d074f39b147cf7ebcb40f6c469e637d
2010-02-19T12:46:56.698865Z
8
tapsa
SourceDescriptions.cs
file
2006-10-09T19:24:56.000000Z
3fb835fbaf7fbbd420a2d180f942567d
2010-02-19T12:46:56.698865Z
8
tapsa
MJPEGConfiguration.cs
file
2006-10-09T19:24:56.000000Z
f6e0ff9871617b5458172849a1e438e9
2010-02-19T12:46:56.698865Z
8
tapsa
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
/// <summary>
/// Some array utilities
/// </summary>
internal class ByteArrayUtils
{
// Check if the array contains needle on specified position
public static bool Compare(byte[] array, byte[] needle, int startIndex)
{
int needleLen = needle.Length;
// compare
for (int i = 0, p = startIndex; i < needleLen; i++, p++)
{
if (array[p] != needle[i])
{
return false;
}
}
return true;
}
// Find subarray in array
public static int Find(byte[] array, byte[] needle, int startIndex, int count)
{
int needleLen = needle.Length;
int index;
while (count >= needleLen)
{
index = Array.IndexOf(array, needle[0], startIndex, count - needleLen + 1);
if (index == -1)
return -1;
int i, p;
// check for needle
for (i = 0, p = index; i < needleLen; i++, p++)
{
if (array[p] != needle[i])
{
break;
}
}
if (i == needleLen)
{
// found needle
return index;
}
count -= (index - startIndex + 1);
startIndex = index + 1;
}
return -1;
}
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
/// <summary>
/// MJPEGConfiguration
/// </summary>
public class MJPEGConfiguration
{
public string source;
public string login;
public string password;
}
}
// Camara Vision
//
// Copyright © Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
using System.Drawing;
using System.IO;
using System.Text;
using System.Threading;
using System.Net;
using videosource;
/// <summary>
/// MJPEGSource - MJPEG stream support
/// </summary>
public class MJPEGSource : IVideoSource
{
private string source;
private string login = null;
private string password = null;
private object userData = null;
private int framesReceived;
private int bytesReceived;
private bool useSeparateConnectionGroup = true;
private const int bufSize = 512 * 1024; // buffer size
private const int readSize = 1024; // portion size to read
private Thread thread = null;
private ManualResetEvent stopEvent = null;
private ManualResetEvent reloadEvent = null;
// new frame event
public event CameraEventHandler NewFrame;
// SeparateConnectioGroup property
// indicates to open WebRequest in separate connection group
public bool SeparateConnectionGroup
{
get { return useSeparateConnectionGroup; }
set { useSeparateConnectionGroup = value; }
}
// VideoSource property
public string VideoSource
{
get { return source; }
set
{
source = value;
// signal to reload
if (thread != null)
reloadEvent.Set();
}
}
// Login property
public string Login
{
get { return login; }
set { login = value; }
}
// Password property
public string Password
{
get { return password; }
set { password = value; }
}
// FramesReceived property
public int FramesReceived
{
get
{
int frames = framesReceived;
framesReceived = 0;
return frames;
}
}
// BytesReceived property
public int BytesReceived
{
get
{
int bytes = bytesReceived;
bytesReceived = 0;
return bytes;
}
}
// UserData property
public object UserData
{
get { return userData; }
set { userData = value; }
}
// Get state of the video source thread
public bool Running
{
get
{
if (thread != null)
{
if (thread.Join(0) == false)
return true;
// the thread is not running, so free resources
Free();
}
return false;
}
}
// Constructor
public MJPEGSource()
{
}
// Start work
public void Start()
{
if (thread == null)
{
framesReceived = 0;
bytesReceived = 0;
// create events
stopEvent = new ManualResetEvent(false);
reloadEvent = new ManualResetEvent(false);
// create and start new thread
thread = new Thread(new ThreadStart(WorkerThread));
thread.Name = source;
thread.Start();
}
}
// Signal thread to stop work
public void SignalToStop()
{
// stop thread
if (thread != null)
{
// signal to stop
stopEvent.Set();
}
}
// Wait for thread stop
public void WaitForStop()
{
if (thread != null)
{
// wait for thread stop
thread.Join();
Free();
}
}
// Abort thread
public void Stop()
{
if (this.Running)
{
thread.Abort();
WaitForStop();
}
}
// Free resources
private void Free()
{
thread = null;
// release events
stopEvent.Close();
stopEvent = null;
reloadEvent.Close();
reloadEvent = null;
}
// Thread entry point
public void WorkerThread()
{
byte[] buffer = new byte[bufSize]; // buffer to read stream
while (true)
{
// reset reload event
reloadEvent.Reset();
HttpWebRequest req = null;
WebResponse resp = null;
Stream stream = null;
byte[] delimiter = null;
byte[] delimiter2 = null;
byte[] boundary = null;
int boundaryLen, delimiterLen = 0, delimiter2Len = 0;
int read, todo = 0, total = 0, pos = 0, align = 1;
int start = 0, stop = 0;
// align
// 1 = searching for image start
// 2 = searching for image end
try
{
// create request
req = (HttpWebRequest) WebRequest.Create(source);
// set login and password
if ((login != null) && (password != null) && (login != ""))
req.Credentials = new NetworkCredential(login, password);
// set connection group name
if (useSeparateConnectionGroup)
req.ConnectionGroupName = GetHashCode().ToString();
// get response
resp = req.GetResponse();
// check content type
string ct = resp.ContentType;
if (ct.IndexOf("multipart/x-mixed-replace") == -1)
throw new ApplicationException("Invalid URL");
// get boundary
ASCIIEncoding encoding = new ASCIIEncoding();
boundary = encoding.GetBytes(ct.Substring(ct.IndexOf("boundary=", 0) + 9));
boundaryLen = boundary.Length;
// get response stream
stream = resp.GetResponseStream();
// loop
while ((!stopEvent.WaitOne(0, true)) && (!reloadEvent.WaitOne(0, true)))
{
// check total read
if (total > bufSize - readSize)
{
total = pos = todo = 0;
}
// read next portion from stream
if ((read = stream.Read(buffer, total, readSize)) == 0)
throw new ApplicationException();
total += read;
todo += read;
// increment received bytes counter
bytesReceived += read;
// does we know the delimiter ?
if (delimiter == null)
{
// find boundary
pos = ByteArrayUtils.Find(buffer, boundary, pos, todo);
if (pos == -1)
{
// was not found
todo = boundaryLen - 1;
pos = total - todo;
continue;
}
todo = total - pos;
if (todo < 2)
continue;
// check new line delimiter type
if (buffer[pos + boundaryLen] == 10)
{
delimiterLen = 2;
delimiter = new byte[2] {10, 10};
delimiter2Len = 1;
delimiter2 = new byte[1] {10};
}
else
{
delimiterLen = 4;
delimiter = new byte[4] {13, 10, 13, 10};
delimiter2Len = 2;
delimiter2 = new byte[2] {13, 10};
}
pos += boundaryLen + delimiter2Len;
todo = total - pos;
}
// search for image
if (align == 1)
{
start = ByteArrayUtils.Find(buffer, delimiter, pos, todo);
if (start != -1)
{
// found delimiter
start += delimiterLen;
pos = start;
todo = total - pos;
align = 2;
}
else
{
// delimiter not found
todo = delimiterLen - 1;
pos = total - todo;
}
}
// search for image end
while ((align == 2) && (todo >= boundaryLen))
{
stop = ByteArrayUtils.Find(buffer, boundary, pos, todo);
if (stop != -1)
{
pos = stop;
todo = total - pos;
// increment frames counter
framesReceived ++;
// image at stop
if (NewFrame != null)
{
Bitmap bmp = (Bitmap) Bitmap.FromStream(new MemoryStream(buffer, start, stop - start));
// notify client
NewFrame(this, new CameraEventArgs(bmp));
// release the image
bmp.Dispose();
bmp = null;
}
// shift array
pos = stop + boundaryLen;
todo = total - pos;
Array.Copy(buffer, pos, buffer, 0, todo);
total = todo;
pos = 0;
align = 1;
}
else
{
// delimiter not found
todo = boundaryLen - 1;
pos = total - todo;
}
}
}
}
catch (WebException ex)
{
System.Diagnostics.Debug.WriteLine("=============: " + ex.Message);
// wait for a while before the next try
Thread.Sleep(250);
}
catch (ApplicationException ex)
{
System.Diagnostics.Debug.WriteLine("=============: " + ex.Message);
// wait for a while before the next try
Thread.Sleep(250);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("=============: " + ex.Message);
}
finally
{
// abort request
if (req != null)
{
req.Abort();
req = null;
}
// close response stream
if (stream != null)
{
stream.Close();
stream = null;
}
// close response
if (resp != null)
{
resp.Close();
resp = null;
}
}
// need to stop ?
if (stopEvent.WaitOne(0, true))
break;
}
}
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
using videosource;
namespace mjpeg
{
/// <summary>
/// Summary description for MJPEGSourcePage.
/// </summary>
public class MJPEGSourcePage : System.Windows.Forms.UserControl, IVideoSourcePage
{
private bool completed = false;
private System.Windows.Forms.TextBox passwordBox;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox loginBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox urlBox;
private System.Windows.Forms.Label label1;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
// new frame event
public event EventHandler StateChanged;
// Constructor
public MJPEGSourcePage()
{
// This call is required by the Windows.Forms Form Designer.
InitializeComponent();
// TODO: Add any initialization after the InitForm call
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component 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.passwordBox = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.loginBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.urlBox = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// passwordBox
//
this.passwordBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.passwordBox.Location = new System.Drawing.Point(70, 70);
this.passwordBox.Name = "passwordBox";
this.passwordBox.Size = new System.Drawing.Size(220, 20);
this.passwordBox.TabIndex = 5;
this.passwordBox.Text = "";
//
// label3
//
this.label3.Location = new System.Drawing.Point(10, 73);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(60, 14);
this.label3.TabIndex = 4;
this.label3.Text = "&Password:";
//
// loginBox
//
this.loginBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.loginBox.Location = new System.Drawing.Point(70, 40);
this.loginBox.Name = "loginBox";
this.loginBox.Size = new System.Drawing.Size(220, 20);
this.loginBox.TabIndex = 3;
this.loginBox.Text = "";
//
// label2
//
this.label2.Location = new System.Drawing.Point(10, 43);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(35, 14);
this.label2.TabIndex = 2;
this.label2.Text = "&Login:";
//
// urlBox
//
this.urlBox.Anchor = ((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right);
this.urlBox.Location = new System.Drawing.Point(70, 10);
this.urlBox.Name = "urlBox";
this.urlBox.Size = new System.Drawing.Size(220, 20);
this.urlBox.TabIndex = 1;
this.urlBox.Text = "";
this.urlBox.TextChanged += new System.EventHandler(this.urlBox_TextChanged);
//
// label1
//
this.label1.Location = new System.Drawing.Point(10, 13);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(41, 14);
this.label1.TabIndex = 0;
this.label1.Text = "&URL:";
//
// MJPEGSourcePage
//
this.Controls.AddRange(new System.Windows.Forms.Control[] {
this.passwordBox,
this.label3,
this.loginBox,
this.label2,
this.urlBox,
this.label1});
this.Name = "MJPEGSourcePage";
this.Size = new System.Drawing.Size(300, 150);
this.ResumeLayout(false);
}
#endregion
// Completed property
public bool Completed
{
get { return completed; }
}
// Show the page
public void Display()
{
urlBox.Focus();
urlBox.SelectionStart = urlBox.TextLength;
}
// Apply the page
public bool Apply()
{
return true;
}
// Get configuration object
public object GetConfiguration()
{
MJPEGConfiguration config = new MJPEGConfiguration();
config.source = urlBox.Text;
config.login = loginBox.Text;
config.password = passwordBox.Text;
return (object) config;
}
// Set configuration
public void SetConfiguration(object config)
{
MJPEGConfiguration cfg = (MJPEGConfiguration) config;
if (cfg != null)
{
urlBox.Text = cfg.source;
loginBox.Text = cfg.login;
passwordBox.Text = cfg.password;
}
}
// URL changed
private void urlBox_TextChanged(object sender, System.EventArgs e)
{
completed = (urlBox.TextLength != 0);
if (StateChanged != null)
StateChanged(this, new EventArgs());
}
}
}
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
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">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</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.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:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<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" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</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>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="$this.Name">
<value>MJPEGSourcePage</value>
</data>
</root>
\ No newline at end of file
// Camara Vision
//
// Copyright © Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
using System.Xml;
using videosource;
/// <summary>
/// MJPEGSourceDescription
/// </summary>
public class MJPEGSourceDescription : IVideoSourceDescription
{
// Name property
public string Name
{
get { return "MJPEG stream"; }
}
// Description property
public string Description
{
get { return "Retrieve Motion JPEG stream from the specified URL"; }
}
// Return settings page
public IVideoSourcePage GetSettingsPage()
{
return new MJPEGSourcePage();
}
// Save configuration
public void SaveConfiguration(XmlTextWriter writer, object config)
{
MJPEGConfiguration cfg = (MJPEGConfiguration) config;
if (cfg != null)
{
writer.WriteAttributeString("source", cfg.source);
writer.WriteAttributeString("login", cfg.login);
writer.WriteAttributeString("password", cfg.password);
}
}
// Load configuration
public object LoadConfiguration(XmlTextReader reader)
{
MJPEGConfiguration config = new MJPEGConfiguration();
try
{
config.source = reader.GetAttribute("source");
config.login = reader.GetAttribute("login");
config.password = reader.GetAttribute("password");
}
catch (Exception)
{
}
return (object) config;
}
// Create video source object
public IVideoSource CreateVideoSource(object config)
{
MJPEGConfiguration cfg = (MJPEGConfiguration) config;
if (cfg != null)
{
MJPEGSource source = new MJPEGSource();
source.VideoSource = cfg.source;
source.Login = cfg.login;
source.Password = cfg.password;
return (IVideoSource) source;
}
return null;
}
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
/// <summary>
/// Some array utilities
/// </summary>
internal class ByteArrayUtils
{
// Check if the array contains needle on specified position
public static bool Compare(byte[] array, byte[] needle, int startIndex)
{
int needleLen = needle.Length;
// compare
for (int i = 0, p = startIndex; i < needleLen; i++, p++)
{
if (array[p] != needle[i])
{
return false;
}
}
return true;
}
// Find subarray in array
public static int Find(byte[] array, byte[] needle, int startIndex, int count)
{
int needleLen = needle.Length;
int index;
while (count >= needleLen)
{
index = Array.IndexOf(array, needle[0], startIndex, count - needleLen + 1);
if (index == -1)
return -1;
int i, p;
// check for needle
for (i = 0, p = index; i < needleLen; i++, p++)
{
if (array[p] != needle[i])
{
break;
}
}
if (i == needleLen)
{
// found needle
return index;
}
count -= (index - startIndex + 1);
startIndex = index + 1;
}
return -1;
}
}
}
// Camara Vision
//
// Copyright Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
/// <summary>
/// MJPEGConfiguration
/// </summary>
public class MJPEGConfiguration
{
public string source;
public string login;
public string password;
}
}
// Camara Vision
//
// Copyright © Andrew Kirillov, 2005-2006
// andrew.kirillov@gmail.com
//
namespace mjpeg
{
using System;
using System.Drawing;
using System.IO;
using System.Text;
using System.Threading;
using System.Net;
using videosource;
/// <summary>
/// MJPEGSource - MJPEG stream support
/// </summary>
public class MJPEGSource : IVideoSource
{
private string source;
private string login = null;
private string password = null;
private object userData = null;
private int framesReceived;
private int bytesReceived;
private bool useSeparateConnectionGroup = true;
private const int bufSize = 512 * 1024; // buffer size
private const int readSize = 1024; // portion size to read
private Thread thread = null;
private ManualResetEvent stopEvent = null;
private ManualResetEvent reloadEvent = null;
// new frame event
public event CameraEventHandler NewFrame;
// SeparateConnectioGroup property
// indicates to open WebRequest in separate connection group
public bool SeparateConnectionGroup
{
get { return useSeparateConnectionGroup; }
set { useSeparateConnectionGroup = value; }
}
// VideoSource property
public string VideoSource
{
get { return source; }
set
{
source = value;
// signal to reload
if (thread != null)
reloadEvent.Set();
}
}
// Login property
public string Login
{
get { return login; }
set { login = value; }
}
// Password property
public string Password
{
get { return password; }
set { password = value; }
}
// FramesReceived property
public int FramesReceived
{
get
{
int frames = framesReceived;
framesReceived = 0;
return frames;
}
}
// BytesReceived property
public int BytesReceived
{
get
{
int bytes = bytesReceived;
bytesReceived = 0;
return bytes;
}
}
// UserData property
public object UserData
{
get { return userData; }
set { userData = value; }
}
// Get state of the video source thread
public bool Running
{
get
{
if (thread != null)
{
if (thread.Join(0) == false)
return true;
// the thread is not running, so free resources
Free();
}
return false;
}
}
// Constructor
public MJPEGSource()
{
}
// Start work
public void Start()
{
if (thread == null)
{
framesReceived = 0;
bytesReceived = 0;
// create events
stopEvent = new ManualResetEvent(false);
reloadEvent = new ManualResetEvent(false);
// create and start new thread
thread = new Thread(new ThreadStart(WorkerThread));
thread.Name = source;
thread.Start();
}
}
// Signal thread to stop work
public void SignalToStop()
{
// stop thread
if (thread != null)
{
// signal to stop
stopEvent.Set();
}
}
// Wait for thread stop
public void WaitForStop()
{
if (thread != null)
{
// wait for thread stop
thread.Join();
Free();
}
}
// Abort thread
public void Stop()
{
if (this.Running)
{
thread.Abort();
WaitForStop();
}
}
// Free resources
private void Free()
{
thread = null;
// release events
stopEvent.Close();
stopEvent = null;
reloadEvent.Close();
reloadEvent = null;
}
// Thread entry point
public void WorkerThread()
{
byte[] buffer = new byte[bufSize]; // buffer to read stream
while (true)
{
// reset reload event
reloadEvent.Reset();
HttpWebRequest req = null;
WebResponse resp = null;
Stream stream = null;
byte[] delimiter = null;
byte[] delimiter2 = null;
byte[] boundary = null;
int boundaryLen, delimiterLen = 0, delimiter2Len = 0;
int read, todo = 0, total = 0, pos = 0, align = 1;
int start = 0, stop = 0;
// align
// 1 = searching for image start
// 2 = searching for image end
try
{
// create request
req = (HttpWebRequest) WebRequest.Create(source);
// set login and password
if ((login != null) && (password != null) && (login != ""))
req.Credentials = new NetworkCredential(login, password);
// set connection group name
if (useSeparateConnectionGroup)
req.ConnectionGroupName = GetHashCode().ToString();
// get response
resp = req.GetResponse();
// check content type
string ct = resp.ContentType;
if (ct.IndexOf("multipart/x-mixed-replace") == -1)
throw new ApplicationException("Invalid URL");
// get boundary
ASCIIEncoding encoding = new ASCIIEncoding();
boundary = encoding.GetBytes(ct.Substring(ct.IndexOf("boundary=", 0) + 9));
boundaryLen = boundary.Length;
// get response stream
stream = resp.GetResponseStream();
// loop
while ((!stopEvent.WaitOne(0, true)) && (!reloadEvent.WaitOne(0, true)))
{
// check total read
if (total > bufSize - readSize)
{
total = pos = todo = 0;
}
// read next portion from stream
if ((read = stream.Read(buffer, total, readSize)) == 0)
throw new ApplicationException();
total += read;
todo += read;
// increment received bytes counter
bytesReceived += read;
// does we know the delimiter ?
if (delimiter == null)
{
// find boundary
pos = ByteArrayUtils.Find(buffer, boundary, pos, todo);
if (pos == -1)
{
// was not found
todo = boundaryLen - 1;
pos = total - todo;
continue;
}
todo = total - pos;
if (todo < 2)
continue;
// check new line delimiter type
if (buffer[pos + boundaryLen] == 10)
{
delimiterLen = 2;
delimiter = new byte[2] {10, 10};
delimiter2Len = 1;
delimiter2 = new byte[1] {10};
}
else
{
delimiterLen = 4;
delimiter = new byte[4] {13, 10, 13, 10};
delimiter2Len = 2;
delimiter2 = new byte[2] {13, 10};
}
pos += boundaryLen + delimiter2Len;
todo = total - pos;
}
// search for image
if (align == 1)
{
start = ByteArrayUtils.Find(buffer, delimiter, pos, todo);
if (start != -1)
{
// found delimiter
start += delimiterLen;
pos = start;
todo = total - pos;
align = 2;
}
else
{
// delimiter not found
todo = delimiterLen - 1;
pos = total - todo;
}
}
// search for image end
while ((align == 2) && (todo >= boundaryLen))
{
stop = ByteArrayUtils.Find(buffer, boundary, pos, todo);
if (stop != -1)
{
pos = stop;
todo = total - pos;
// increment frames counter
framesReceived ++;
// image at stop
if (NewFrame != null)
{
Bitmap bmp = (Bitmap) Bitmap.FromStream(new MemoryStream(buffer, start, stop - start));
// notify client
NewFrame(this, new CameraEventArgs(bmp));
// release the image
bmp.Dispose();
bmp = null;
}
// shift array
pos = stop + boundaryLen;
todo = total - pos;
Array.Copy(buffer, pos, buffer, 0, todo);
total = todo;
pos = 0;
align = 1;
}
else
{
// delimiter not found
todo = boundaryLen - 1;
pos = total - todo;
}
}
}
}
catch (WebException ex)
{
System.Diagnostics.Debug.WriteLine("=============: " + ex.Message);
// wait for a while before the next try
Thread.Sleep(250);
}
catch (ApplicationException ex)
{
System.Diagnostics.Debug.WriteLine("=============: " + ex.Message);
// wait for a while before the next try
Thread.Sleep(250);
}
catch (Exception ex)
{
System.Diagnostics.Debug.WriteLine("=============: " + ex.Message);
}
finally
{
// abort request
if (req != null)
{
req.Abort();
req = null;
}
// close response stream
if (stream != null)
{
stream.Close();
stream = null;
}
// close response
if (resp != null)
{
resp.Close();
resp = null;
}
}
// need to stop ?
if (stopEvent.WaitOne(0, true))
break;
}
}
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!