diff --git a/PAFAXClient.sln b/PAFAXClient.sln new file mode 100644 index 0000000..053305b --- /dev/null +++ b/PAFAXClient.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2024 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PAFAXClient", "PAFAXClient\PAFAXClient.csproj", "{C6CBD06D-63E4-4900-AE3B-6CA679D4F1EA}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {C6CBD06D-63E4-4900-AE3B-6CA679D4F1EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C6CBD06D-63E4-4900-AE3B-6CA679D4F1EA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C6CBD06D-63E4-4900-AE3B-6CA679D4F1EA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C6CBD06D-63E4-4900-AE3B-6CA679D4F1EA}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {424E174D-35D3-4322-9C0C-9540D0233B96} + EndGlobalSection +EndGlobal diff --git a/PAFAXClient/App.config b/PAFAXClient/App.config new file mode 100644 index 0000000..731f6de --- /dev/null +++ b/PAFAXClient/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/PAFAXClient/Form1.Designer.cs b/PAFAXClient/Form1.Designer.cs new file mode 100644 index 0000000..085c676 --- /dev/null +++ b/PAFAXClient/Form1.Designer.cs @@ -0,0 +1,214 @@ +namespace PAFAXClient +{ + partial class Form1 + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Windows Form-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + this.splitContainer1 = new System.Windows.Forms.SplitContainer(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.bAddRecv = new System.Windows.Forms.Button(); + this.tbReceiver = new System.Windows.Forms.TextBox(); + this.lbReceiver = new System.Windows.Forms.ListBox(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.label1 = new System.Windows.Forms.Label(); + this.textBox1 = new System.Windows.Forms.TextBox(); + this.tbSource = new System.Windows.Forms.TextBox(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.button1 = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); + this.splitContainer1.Panel1.SuspendLayout(); + this.splitContainer1.Panel2.SuspendLayout(); + this.splitContainer1.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.SuspendLayout(); + // + // splitContainer1 + // + this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill; + this.splitContainer1.Location = new System.Drawing.Point(0, 0); + this.splitContainer1.Name = "splitContainer1"; + // + // splitContainer1.Panel1 + // + this.splitContainer1.Panel1.Controls.Add(this.groupBox1); + // + // splitContainer1.Panel2 + // + this.splitContainer1.Panel2.Controls.Add(this.tbSource); + this.splitContainer1.Panel2.Controls.Add(this.groupBox2); + this.splitContainer1.Size = new System.Drawing.Size(1043, 632); + this.splitContainer1.SplitterDistance = 340; + this.splitContainer1.TabIndex = 1; + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.bAddRecv); + this.groupBox1.Controls.Add(this.tbReceiver); + this.groupBox1.Controls.Add(this.lbReceiver); + this.groupBox1.Dock = System.Windows.Forms.DockStyle.Fill; + this.groupBox1.Location = new System.Drawing.Point(0, 0); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(340, 632); + this.groupBox1.TabIndex = 0; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Empfänger"; + // + // bAddRecv + // + this.bAddRecv.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.bAddRecv.Location = new System.Drawing.Point(240, 17); + this.bAddRecv.Name = "bAddRecv"; + this.bAddRecv.Size = new System.Drawing.Size(94, 23); + this.bAddRecv.TabIndex = 2; + this.bAddRecv.Text = "hinzufügen"; + this.bAddRecv.UseVisualStyleBackColor = true; + this.bAddRecv.Click += new System.EventHandler(this.bAddRecv_Click); + // + // tbReceiver + // + this.tbReceiver.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbReceiver.Location = new System.Drawing.Point(6, 19); + this.tbReceiver.Name = "tbReceiver"; + this.tbReceiver.Size = new System.Drawing.Size(228, 20); + this.tbReceiver.TabIndex = 1; + this.tbReceiver.TextChanged += new System.EventHandler(this.tbReceiver_TextChanged); + this.tbReceiver.KeyUp += new System.Windows.Forms.KeyEventHandler(this.tbReceiver_KeyUp); + // + // lbReceiver + // + this.lbReceiver.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.lbReceiver.FormattingEnabled = true; + this.lbReceiver.Location = new System.Drawing.Point(6, 45); + this.lbReceiver.Name = "lbReceiver"; + this.lbReceiver.Size = new System.Drawing.Size(328, 576); + this.lbReceiver.TabIndex = 0; + // + // groupBox2 + // + this.groupBox2.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.groupBox2.Controls.Add(this.button1); + this.groupBox2.Controls.Add(this.textBox1); + this.groupBox2.Controls.Add(this.label1); + this.groupBox2.Location = new System.Drawing.Point(3, 3); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(684, 197); + this.groupBox2.TabIndex = 1; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "Druckjob"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(6, 24); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(89, 13); + this.label1.TabIndex = 0; + this.label1.Text = "Job Bezeichnung"; + // + // textBox1 + // + this.textBox1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.textBox1.Location = new System.Drawing.Point(121, 21); + this.textBox1.Name = "textBox1"; + this.textBox1.Size = new System.Drawing.Size(557, 20); + this.textBox1.TabIndex = 1; + // + // tbSource + // + this.tbSource.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + this.tbSource.Location = new System.Drawing.Point(3, 206); + this.tbSource.Multiline = true; + this.tbSource.Name = "tbSource"; + this.tbSource.ScrollBars = System.Windows.Forms.ScrollBars.Both; + this.tbSource.Size = new System.Drawing.Size(684, 414); + this.tbSource.TabIndex = 2; + // + // timer1 + // + this.timer1.Enabled = true; + this.timer1.Interval = 500; + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // button1 + // + this.button1.Location = new System.Drawing.Point(603, 168); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(75, 23); + this.button1.TabIndex = 2; + this.button1.Text = "button1"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // Form1 + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.ClientSize = new System.Drawing.Size(1043, 632); + this.Controls.Add(this.splitContainer1); + this.DoubleBuffered = true; + this.Name = "Form1"; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "PAFax Client - FAX senden..."; + this.Shown += new System.EventHandler(this.Form1_Shown); + this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel2.ResumeLayout(false); + this.splitContainer1.Panel2.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); + this.splitContainer1.ResumeLayout(false); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.SplitContainer splitContainer1; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button bAddRecv; + private System.Windows.Forms.TextBox tbReceiver; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.TextBox textBox1; + private System.Windows.Forms.Label label1; + public System.Windows.Forms.TextBox tbSource; + private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.Button button1; + public System.Windows.Forms.ListBox lbReceiver; + } +} + diff --git a/PAFAXClient/Form1.cs b/PAFAXClient/Form1.cs new file mode 100644 index 0000000..eae1a53 --- /dev/null +++ b/PAFAXClient/Form1.cs @@ -0,0 +1,86 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.IO; + +namespace PAFAXClient +{ + public partial class Form1 : Form + { + [DllImport("user32.dll")] + private static extern bool SetForegroundWindow(IntPtr hWnd); + + + private byte[] jobdata; + + public Form1() + { + InitializeComponent(); + WindowState = FormWindowState.Minimized; + } + + private void label1_Click(object sender, EventArgs e) + { + + } + + private void tbReceiver_TextChanged(object sender, EventArgs e) + { + + } + + private void bAddRecv_Click(object sender, EventArgs e) + { + string receiver = tbReceiver.Text; + lbReceiver.Items.Add(receiver); + tbReceiver.Text = ""; + tbReceiver.Focus(); + } + + private void tbReceiver_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + bAddRecv_Click(sender,e); + } + } + + private void Form1_Shown(object sender, EventArgs e) + { + timer1.Start(); + } + + private void timer1_Tick(object sender, EventArgs e) + { + WindowState = FormWindowState.Normal; + SetForegroundWindow(this.Handle); + timer1.Stop(); + tbReceiver.Focus(); + } + + public void setJobData(byte[] jobdata) + { + this.jobdata = jobdata; + tbSource.Text = Encoding.UTF8.GetString(jobdata); + } + + private void button1_Click(object sender, EventArgs e) + { + SaveFileDialog sfd = new SaveFileDialog(); + sfd.Filter = "PostScript Files|*.ps"; + if (sfd.ShowDialog() == DialogResult.OK) + { + FileStream s = new FileStream(sfd.FileName, FileMode.Create); + s.Write(this.jobdata,0,this.jobdata.Length); + s.Close(); + } + } + } +} diff --git a/PAFAXClient/Form1.resx b/PAFAXClient/Form1.resx new file mode 100644 index 0000000..1f666f2 --- /dev/null +++ b/PAFAXClient/Form1.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + \ No newline at end of file diff --git a/PAFAXClient/PAFAXClient.csproj b/PAFAXClient/PAFAXClient.csproj new file mode 100644 index 0000000..1dad440 --- /dev/null +++ b/PAFAXClient/PAFAXClient.csproj @@ -0,0 +1,82 @@ + + + + + Debug + AnyCPU + {C6CBD06D-63E4-4900-AE3B-6CA679D4F1EA} + WinExe + PAFAXClient + PAFAXClient + v4.6.1 + 512 + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + Form + + + Form1.cs + + + + + Form1.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + \ No newline at end of file diff --git a/PAFAXClient/Program.cs b/PAFAXClient/Program.cs new file mode 100644 index 0000000..c9a9509 --- /dev/null +++ b/PAFAXClient/Program.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Threading.Tasks; +using System.Windows.Forms; +using System.IO; +using System.Text; + +namespace PAFAXClient +{ + static class Program + { + /// + /// Der Haupteinstiegspunkt für die Anwendung. + /// + [STAThread] + static void Main(String[] arguments) + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + + Form1 form1 = new Form1(); + + if (arguments.Length > 0) + { + if (arguments[0].Equals("--printer")) + { + Stream stdin = Console.OpenStandardInput(); + byte[] buffer = new byte[1048576]; + + MemoryStream ms = new MemoryStream(); + int n; + + do + { + n = stdin.Read(buffer, 0, buffer.Length); + if (n > 0) + { + ms.Write(buffer, 0, n); + form1.lbReceiver.Items.Add(String.Format("Got {0} bytes jobdata", n)); + } + } while (n > 0); + + byte[] jobdata = ms.ToArray(); + + form1.lbReceiver.Items.Add(String.Format("Resulting Job Length: {0} bytes", jobdata.Length)); + form1.setJobData(jobdata); + } + } + + Application.Run(form1); + } + } +} diff --git a/PAFAXClient/Properties/AssemblyInfo.cs b/PAFAXClient/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b759ebc --- /dev/null +++ b/PAFAXClient/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die einer Assembly zugeordnet sind. +[assembly: AssemblyTitle("PAFAXClient")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("PAFAXClient")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2018")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly +// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von +// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("c6cbd06d-63e4-4900-ae3b-6ca679d4f1ea")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden, +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/PAFAXClient/Properties/Resources.Designer.cs b/PAFAXClient/Properties/Resources.Designer.cs new file mode 100644 index 0000000..ab1bf63 --- /dev/null +++ b/PAFAXClient/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion: 4.0.30319.42000 +// +// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn +// der Code neu generiert wird. +// +//------------------------------------------------------------------------------ + +namespace PAFAXClient.Properties +{ + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse + // über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. + [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() + { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager + { + get + { + if ((resourceMan == null)) + { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("PAFAXClient.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture + { + get + { + return resourceCulture; + } + set + { + resourceCulture = value; + } + } + } +} diff --git a/PAFAXClient/Properties/Resources.resx b/PAFAXClient/Properties/Resources.resx new file mode 100644 index 0000000..af7dbeb --- /dev/null +++ b/PAFAXClient/Properties/Resources.resx @@ -0,0 +1,117 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/PAFAXClient/Properties/Settings.Designer.cs b/PAFAXClient/Properties/Settings.Designer.cs new file mode 100644 index 0000000..4a18113 --- /dev/null +++ b/PAFAXClient/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace PAFAXClient.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.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; + } + } + } +} diff --git a/PAFAXClient/Properties/Settings.settings b/PAFAXClient/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/PAFAXClient/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + +