Projektdateien hinzufügen.

This commit is contained in:
Schedel Pascal
2024-08-22 06:25:24 +02:00
parent 239f22b74f
commit a9e18dd127
14 changed files with 2302 additions and 0 deletions

184
Pilz.Tools.StringCrypter/Form1.Designer.cs generated Normal file
View File

@@ -0,0 +1,184 @@
namespace Pilz.Tools.StringCrypter;
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));
tableLayoutPanel1 = new TableLayoutPanel();
radTextBox_Input = new Telerik.WinControls.UI.RadTextBox();
radTextBox_Output = new Telerik.WinControls.UI.RadTextBox();
radButton_Paste = new Telerik.WinControls.UI.RadButton();
radButton_Copy = new Telerik.WinControls.UI.RadButton();
radToggleSwitch_Mode = new Telerik.WinControls.UI.RadToggleSwitch();
radTextBox_Key = new Telerik.WinControls.UI.RadTextBox();
tableLayoutPanel1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)radTextBox_Input).BeginInit();
((System.ComponentModel.ISupportInitialize)radTextBox_Output).BeginInit();
((System.ComponentModel.ISupportInitialize)radButton_Paste).BeginInit();
((System.ComponentModel.ISupportInitialize)radButton_Copy).BeginInit();
((System.ComponentModel.ISupportInitialize)radToggleSwitch_Mode).BeginInit();
((System.ComponentModel.ISupportInitialize)radTextBox_Key).BeginInit();
((System.ComponentModel.ISupportInitialize)this).BeginInit();
SuspendLayout();
//
// tableLayoutPanel1
//
tableLayoutPanel1.ColumnCount = 4;
tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableLayoutPanel1.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F));
tableLayoutPanel1.Controls.Add(radTextBox_Input, 0, 1);
tableLayoutPanel1.Controls.Add(radTextBox_Output, 2, 1);
tableLayoutPanel1.Controls.Add(radButton_Paste, 0, 0);
tableLayoutPanel1.Controls.Add(radButton_Copy, 3, 0);
tableLayoutPanel1.Controls.Add(radToggleSwitch_Mode, 1, 0);
tableLayoutPanel1.Controls.Add(radTextBox_Key, 2, 0);
tableLayoutPanel1.Dock = DockStyle.Fill;
tableLayoutPanel1.Location = new Point(0, 0);
tableLayoutPanel1.Name = "tableLayoutPanel1";
tableLayoutPanel1.RowCount = 2;
tableLayoutPanel1.RowStyles.Add(new RowStyle());
tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F));
tableLayoutPanel1.Size = new Size(492, 320);
tableLayoutPanel1.TabIndex = 0;
//
// radTextBox_Input
//
radTextBox_Input.AcceptsReturn = true;
radTextBox_Input.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
radTextBox_Input.AutoScroll = true;
tableLayoutPanel1.SetColumnSpan(radTextBox_Input, 2);
radTextBox_Input.Location = new Point(3, 33);
radTextBox_Input.Multiline = true;
radTextBox_Input.Name = "radTextBox_Input";
radTextBox_Input.NullText = "Input";
//
//
//
radTextBox_Input.RootElement.StretchVertically = true;
radTextBox_Input.Size = new Size(240, 284);
radTextBox_Input.TabIndex = 0;
radTextBox_Input.TextChanged += RadTextBox_Input_TextChanged;
//
// radTextBox_Output
//
radTextBox_Output.AcceptsReturn = true;
radTextBox_Output.Anchor = AnchorStyles.Top | AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right;
radTextBox_Output.AutoScroll = true;
tableLayoutPanel1.SetColumnSpan(radTextBox_Output, 2);
radTextBox_Output.Location = new Point(249, 33);
radTextBox_Output.Multiline = true;
radTextBox_Output.Name = "radTextBox_Output";
radTextBox_Output.NullText = "Output";
//
//
//
radTextBox_Output.RootElement.StretchVertically = true;
radTextBox_Output.Size = new Size(240, 284);
radTextBox_Output.TabIndex = 1;
//
// radButton_Paste
//
radButton_Paste.ImageAlignment = ContentAlignment.MiddleRight;
radButton_Paste.Location = new Point(3, 3);
radButton_Paste.Name = "radButton_Paste";
radButton_Paste.Size = new Size(110, 24);
radButton_Paste.TabIndex = 2;
radButton_Paste.Text = "Paste";
radButton_Paste.TextAlignment = ContentAlignment.MiddleLeft;
radButton_Paste.TextImageRelation = TextImageRelation.ImageBeforeText;
radButton_Paste.Click += RadButton_Paste_Click;
//
// radButton_Copy
//
radButton_Copy.Anchor = AnchorStyles.Top | AnchorStyles.Right;
radButton_Copy.ImageAlignment = ContentAlignment.MiddleRight;
radButton_Copy.Location = new Point(379, 3);
radButton_Copy.Name = "radButton_Copy";
radButton_Copy.Size = new Size(110, 24);
radButton_Copy.TabIndex = 3;
radButton_Copy.Text = "Copy";
radButton_Copy.TextAlignment = ContentAlignment.MiddleLeft;
radButton_Copy.TextImageRelation = TextImageRelation.ImageBeforeText;
radButton_Copy.Click += RadButton_Copy_Click;
//
// radToggleSwitch_Mode
//
radToggleSwitch_Mode.Anchor = AnchorStyles.Top | AnchorStyles.Right;
radToggleSwitch_Mode.Location = new Point(143, 3);
radToggleSwitch_Mode.Name = "radToggleSwitch_Mode";
radToggleSwitch_Mode.OffText = "Decrypt";
radToggleSwitch_Mode.OnText = "Encrypt";
radToggleSwitch_Mode.Size = new Size(100, 24);
radToggleSwitch_Mode.TabIndex = 5;
radToggleSwitch_Mode.ValueChanged += RadToggleSwitch_Mode_ValueChanged;
//
// radTextBox_Key
//
radTextBox_Key.AutoSize = false;
radTextBox_Key.Location = new Point(249, 3);
radTextBox_Key.Name = "radTextBox_Key";
radTextBox_Key.NullText = "Key";
radTextBox_Key.Size = new Size(100, 24);
radTextBox_Key.TabIndex = 6;
radTextBox_Key.TextChanged += RadTextBox_Key_TextChanged;
//
// Form1
//
AutoScaleBaseSize = new Size(7, 15);
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(492, 320);
Controls.Add(tableLayoutPanel1);
Icon = (Icon)resources.GetObject("$this.Icon");
Name = "Form1";
StartPosition = FormStartPosition.CenterScreen;
Text = "String crypter";
tableLayoutPanel1.ResumeLayout(false);
tableLayoutPanel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)radTextBox_Input).EndInit();
((System.ComponentModel.ISupportInitialize)radTextBox_Output).EndInit();
((System.ComponentModel.ISupportInitialize)radButton_Paste).EndInit();
((System.ComponentModel.ISupportInitialize)radButton_Copy).EndInit();
((System.ComponentModel.ISupportInitialize)radToggleSwitch_Mode).EndInit();
((System.ComponentModel.ISupportInitialize)radTextBox_Key).EndInit();
((System.ComponentModel.ISupportInitialize)this).EndInit();
ResumeLayout(false);
}
#endregion
private TableLayoutPanel tableLayoutPanel1;
private Telerik.WinControls.UI.RadTextBox radTextBox_Input;
private Telerik.WinControls.UI.RadTextBox radTextBox_Output;
private Telerik.WinControls.UI.RadButton radButton_Paste;
private Telerik.WinControls.UI.RadButton radButton_Copy;
private Telerik.WinControls.UI.RadToggleSwitch radToggleSwitch_Mode;
private Telerik.WinControls.UI.RadTextBox radTextBox_Key;
}

View File

@@ -0,0 +1,60 @@
using Pilz.Cryptography;
using Pilz.Tools.Symbols;
using Telerik.WinControls.UI;
namespace Pilz.Tools.StringCrypter;
public partial class Form1 : RadForm
{
private ICrypter? crypter;
public Form1()
{
InitializeComponent();
radButton_Copy.SvgImage = GlobalSymbolFactory.Instance.GetSvgImage(GlobalSymbols.copy, UI.Symbols.SymbolSize.x16);
radButton_Paste.SvgImage = GlobalSymbolFactory.Instance.GetSvgImage(GlobalSymbols.paste_as_text, UI.Symbols.SymbolSize.x16);
}
private void RadButton_Copy_Click(object sender, EventArgs e)
{
Clipboard.SetText(radTextBox_Output.Text);
}
private void RadButton_Paste_Click(object sender, EventArgs e)
{
radTextBox_Input.Text = Clipboard.GetText();
}
private void RadToggleSwitch_Mode_ValueChanged(object sender, EventArgs e)
{
DoEncryption();
}
private void RadTextBox_Key_TextChanged(object sender, EventArgs e)
{
crypter = null;
DoEncryption();
}
private void RadTextBox_Input_TextChanged(object sender, EventArgs e)
{
DoEncryption();
}
private void DoEncryption()
{
crypter ??= new SimpleStringCrypter(radTextBox_Key.Text);
try
{
if (radToggleSwitch_Mode.Value)
radTextBox_Output.Text = crypter.Encrypt(radTextBox_Input.Text);
else
radTextBox_Output.Text = crypter.Decrypt(radTextBox_Input.Text);
}
catch (Exception)
{
radTextBox_Output.Text = null;
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWindowsForms>true</UseWindowsForms>
<ImplicitUsings>enable</ImplicitUsings>
<ApplicationIcon>icons8_data_encryption.ico</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Pilz.Cryptography" Version="2.1.0" />
<PackageReference Include="UI.for.WinForms.Common" Version="2024.3.806" />
<PackageReference Include="UI.for.WinForms.Themes" Version="2024.3.806" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Pilz.Tools.Symbols\Pilz.Tools.Symbols.csproj" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,20 @@
using Telerik.WinControls;
using Telerik.WinControls.Themes;
namespace Pilz.Tools.StringCrypter;
internal static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
ThemeResolutionService.ApplicationThemeName = WindowsSettings.AppsUseLightTheme ? new Windows11CompactTheme().ThemeName : new Windows11CompactDarkTheme().ThemeName;
Application.Run(new Form1());
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 101 KiB