Parę nowych dodatków:
* Opóżnienie pojawienia
* Pokaż po wciśnięciu ikony na pasku powiadomień
This commit is contained in:
Christopher
2021-01-27 23:45:52 +01:00
parent dafe8b4e3c
commit 6dd8d50aa0
25 changed files with 2904 additions and 35 deletions
+18
View File
@@ -1,6 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="ErrorGenerator.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<userSettings>
<ErrorGenerator.Properties.Settings>
<setting name="Ikona" serializeAs="String">
<value />
</setting>
<setting name="TytulIkony" serializeAs="String">
<value>Pokaż sztuczny błąd</value>
</setting>
<setting name="Klikniecie" serializeAs="String">
<value>0</value>
</setting>
</ErrorGenerator.Properties.Settings>
</userSettings>
</configuration>
+9
View File
@@ -78,6 +78,12 @@
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="UstawieniaNotify.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="UstawieniaNotify.Designer.cs">
<DependentUpon>UstawieniaNotify.cs</DependentUpon>
</Compile>
<EmbeddedResource Include="Form1.resx">
<DependentUpon>Form1.cs</DependentUpon>
</EmbeddedResource>
@@ -91,6 +97,9 @@
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<EmbeddedResource Include="UstawieniaNotify.resx">
<DependentUpon>UstawieniaNotify.cs</DependentUpon>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
+129 -26
View File
@@ -29,6 +29,7 @@ namespace ErrorGenerator
/// </summary>
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.label1 = new System.Windows.Forms.Label();
this.title = new System.Windows.Forms.TextBox();
@@ -41,50 +42,63 @@ namespace ErrorGenerator
this.generate = new System.Windows.Forms.Button();
this.label6 = new System.Windows.Forms.Label();
this.linkLabel1 = new System.Windows.Forms.LinkLabel();
this.label5 = new System.Windows.Forms.Label();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.label7 = new System.Windows.Forms.Label();
this.checkBox1 = new System.Windows.Forms.CheckBox();
this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components);
this.button1 = new System.Windows.Forms.Button();
this.progressBar1 = new System.Windows.Forms.ProgressBar();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(13, 13);
this.label1.Location = new System.Drawing.Point(17, 16);
this.label1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(35, 13);
this.label1.Size = new System.Drawing.Size(43, 17);
this.label1.TabIndex = 0;
this.label1.Text = "Tytuł:";
//
// title
//
this.title.Location = new System.Drawing.Point(12, 29);
this.title.Location = new System.Drawing.Point(16, 36);
this.title.Margin = new System.Windows.Forms.Padding(4);
this.title.Name = "title";
this.title.Size = new System.Drawing.Size(253, 20);
this.title.Size = new System.Drawing.Size(336, 22);
this.title.TabIndex = 1;
this.title.Text = "Witaj, świecie!";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(13, 52);
this.label2.Location = new System.Drawing.Point(17, 64);
this.label2.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(37, 13);
this.label2.Size = new System.Drawing.Size(47, 17);
this.label2.TabIndex = 2;
this.label2.Text = "Tekst:";
//
// text
//
this.text.Location = new System.Drawing.Point(12, 68);
this.text.Location = new System.Drawing.Point(16, 84);
this.text.Margin = new System.Windows.Forms.Padding(4);
this.text.Multiline = true;
this.text.Name = "text";
this.text.ScrollBars = System.Windows.Forms.ScrollBars.Both;
this.text.Size = new System.Drawing.Size(253, 176);
this.text.Size = new System.Drawing.Size(336, 216);
this.text.TabIndex = 3;
this.text.Text = "Jestem programem do tworzenia sztucznych błędów systemowych :) ";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(268, 9);
this.label3.Location = new System.Drawing.Point(357, 11);
this.label3.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(51, 13);
this.label3.Size = new System.Drawing.Size(67, 17);
this.label3.TabIndex = 4;
this.label3.Text = "Przyciski:";
//
@@ -98,18 +112,20 @@ namespace ErrorGenerator
"Ponów, Anuluj",
"Tak, Nie",
"Tak, Nie, Anuluj"});
this.buttons.Location = new System.Drawing.Point(271, 28);
this.buttons.Location = new System.Drawing.Point(361, 34);
this.buttons.Margin = new System.Windows.Forms.Padding(4);
this.buttons.Name = "buttons";
this.buttons.Size = new System.Drawing.Size(140, 21);
this.buttons.Size = new System.Drawing.Size(185, 24);
this.buttons.TabIndex = 5;
this.buttons.Text = "OK";
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(268, 52);
this.label4.Location = new System.Drawing.Point(357, 64);
this.label4.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(56, 13);
this.label4.Size = new System.Drawing.Size(71, 17);
this.label4.TabIndex = 6;
this.label4.Text = "Typ błędu";
//
@@ -121,17 +137,19 @@ namespace ErrorGenerator
"Informacyjny",
"Ostrzegawczy",
"Pytajnik"});
this.type.Location = new System.Drawing.Point(271, 68);
this.type.Location = new System.Drawing.Point(361, 84);
this.type.Margin = new System.Windows.Forms.Padding(4);
this.type.Name = "type";
this.type.Size = new System.Drawing.Size(140, 21);
this.type.Size = new System.Drawing.Size(185, 24);
this.type.TabIndex = 7;
this.type.Text = "Informacyjny";
//
// generate
//
this.generate.Location = new System.Drawing.Point(271, 221);
this.generate.Location = new System.Drawing.Point(361, 272);
this.generate.Margin = new System.Windows.Forms.Padding(4);
this.generate.Name = "generate";
this.generate.Size = new System.Drawing.Size(140, 23);
this.generate.Size = new System.Drawing.Size(187, 28);
this.generate.TabIndex = 10;
this.generate.Text = "Generuj";
this.generate.UseVisualStyleBackColor = true;
@@ -140,28 +158,104 @@ namespace ErrorGenerator
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(12, 251);
this.label6.Location = new System.Drawing.Point(16, 309);
this.label6.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(156, 13);
this.label6.Size = new System.Drawing.Size(208, 17);
this.label6.TabIndex = 11;
this.label6.Text = "Stworzone przez KrzysiekSiemv";
//
// linkLabel1
//
this.linkLabel1.AutoSize = true;
this.linkLabel1.Location = new System.Drawing.Point(175, 251);
this.linkLabel1.Location = new System.Drawing.Point(233, 309);
this.linkLabel1.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0);
this.linkLabel1.Name = "linkLabel1";
this.linkLabel1.Size = new System.Drawing.Size(40, 13);
this.linkLabel1.Size = new System.Drawing.Size(52, 17);
this.linkLabel1.TabIndex = 12;
this.linkLabel1.TabStop = true;
this.linkLabel1.Text = "GitHub";
this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkClicked);
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(359, 112);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(151, 17);
this.label5.TabIndex = 13;
this.label5.Text = "Opóżnienie (sekundy):";
//
// numericUpDown1
//
this.numericUpDown1.Location = new System.Drawing.Point(362, 132);
this.numericUpDown1.Maximum = new decimal(new int[] {
100000,
0,
0,
0});
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(184, 22);
this.numericUpDown1.TabIndex = 14;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(359, 157);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(35, 17);
this.label7.TabIndex = 15;
this.label7.Text = "Inne";
//
// checkBox1
//
this.checkBox1.AutoSize = true;
this.checkBox1.Location = new System.Drawing.Point(361, 178);
this.checkBox1.Name = "checkBox1";
this.checkBox1.Size = new System.Drawing.Size(191, 55);
this.checkBox1.TabIndex = 16;
this.checkBox1.Text = "Pokaż błąd po wciśnięciu \r\nprzycisku na pasku \r\npowiadomień";
this.checkBox1.UseVisualStyleBackColor = true;
this.checkBox1.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
//
// notifyIcon1
//
this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon")));
this.notifyIcon1.Text = "Pokaż błąd";
this.notifyIcon1.Click += new System.EventHandler(this.notifyIcon1_Click);
this.notifyIcon1.DoubleClick += new System.EventHandler(this.notifyIcon1_DoubleClick);
//
// button1
//
this.button1.Location = new System.Drawing.Point(362, 237);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(184, 28);
this.button1.TabIndex = 17;
this.button1.Text = "Ustawienia Notify";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// progressBar1
//
this.progressBar1.Location = new System.Drawing.Point(428, 302);
this.progressBar1.Maximum = 100000;
this.progressBar1.Name = "progressBar1";
this.progressBar1.Size = new System.Drawing.Size(100, 23);
this.progressBar1.Step = 1;
this.progressBar1.TabIndex = 18;
this.progressBar1.Visible = false;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(421, 274);
this.ClientSize = new System.Drawing.Size(559, 327);
this.Controls.Add(this.progressBar1);
this.Controls.Add(this.button1);
this.Controls.Add(this.checkBox1);
this.Controls.Add(this.label7);
this.Controls.Add(this.numericUpDown1);
this.Controls.Add(this.label5);
this.Controls.Add(this.linkLabel1);
this.Controls.Add(this.label6);
this.Controls.Add(this.generate);
@@ -175,13 +269,15 @@ namespace ErrorGenerator
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.Margin = new System.Windows.Forms.Padding(4);
this.MaximizeBox = false;
this.MaximumSize = new System.Drawing.Size(437, 313);
this.MaximumSize = new System.Drawing.Size(577, 374);
this.MinimizeBox = false;
this.MinimumSize = new System.Drawing.Size(437, 313);
this.MinimumSize = new System.Drawing.Size(577, 374);
this.Name = "Form1";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "ErGen - Generator błędów";
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
@@ -200,6 +296,13 @@ namespace ErrorGenerator
private System.Windows.Forms.Button generate;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.LinkLabel linkLabel1;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.CheckBox checkBox1;
private System.Windows.Forms.NotifyIcon notifyIcon1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.ProgressBar progressBar1;
}
}
+41 -2
View File
@@ -1,6 +1,7 @@
using System;
using System.Windows.Forms;
using System.Drawing;
using System.Threading;
namespace ErrorGenerator
{
public partial class Form1 : Form
@@ -12,7 +13,13 @@ namespace ErrorGenerator
private void generate_Click(object sender, EventArgs e)
{
showMessage(title.Text, text.Text, buttons.SelectedIndex, type.SelectedIndex);
if (numericUpDown1.Value != 0)
{
Thread.Sleep(Convert.ToInt32(numericUpDown1.Value * 1000));
showMessage(title.Text, text.Text, buttons.SelectedIndex, type.SelectedIndex);
}
else
showMessage(title.Text, text.Text, buttons.SelectedIndex, type.SelectedIndex);
}
void showMessage(string title, string text, int buttons, int types)
@@ -57,5 +64,37 @@ namespace ErrorGenerator
linkLabel1.LinkVisited = true;
System.Diagnostics.Process.Start("https://github.com/KrzysiekSiemv");
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
Properties.Settings settings = new Properties.Settings();
if(settings.Ikona != "")
notifyIcon1.Icon = new Icon(settings.Ikona);
notifyIcon1.Text = settings.TytulIkony;
if (checkBox1.Checked)
notifyIcon1.Visible = true;
else
notifyIcon1.Visible = false;
}
private void notifyIcon1_DoubleClick(object sender, EventArgs e)
{
if(Properties.Settings.Default.Klikniecie == 1)
showMessage(title.Text, text.Text, buttons.SelectedIndex, type.SelectedIndex);
}
private void notifyIcon1_Click(object sender, EventArgs e)
{
if (Properties.Settings.Default.Klikniecie == 0)
showMessage(title.Text, text.Text, buttons.SelectedIndex, type.SelectedIndex);
}
private void button1_Click(object sender, EventArgs e)
{
UstawieniaNotify ustawienia = new UstawieniaNotify();
ustawienia.Show();
}
}
}
File diff suppressed because it is too large Load Diff
+36
View File
@@ -22,5 +22,41 @@ namespace ErrorGenerator.Properties {
return defaultInstance;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("")]
public string Ikona {
get {
return ((string)(this["Ikona"]));
}
set {
this["Ikona"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("Pokaż sztuczny błąd")]
public string TytulIkony {
get {
return ((string)(this["TytulIkony"]));
}
set {
this["TytulIkony"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("0")]
public int Klikniecie {
get {
return ((int)(this["Klikniecie"]));
}
set {
this["Klikniecie"] = value;
}
}
}
}
+14 -6
View File
@@ -1,7 +1,15 @@
<?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>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="ErrorGenerator.Properties" GeneratedClassName="Settings">
<Profiles />
<Settings>
<Setting Name="Ikona" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="TytulIkony" Type="System.String" Scope="User">
<Value Profile="(Default)">Pokaż sztuczny błąd</Value>
</Setting>
<Setting Name="Klikniecie" Type="System.Int32" Scope="User">
<Value Profile="(Default)">0</Value>
</Setting>
</Settings>
</SettingsFile>
+173
View File
@@ -0,0 +1,173 @@
namespace ErrorGenerator
{
partial class UstawieniaNotify
{
/// <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(UstawieniaNotify));
this.textBox1 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.button1 = new System.Windows.Forms.Button();
this.label2 = new System.Windows.Forms.Label();
this.textBox2 = new System.Windows.Forms.TextBox();
this.radioButton1 = new System.Windows.Forms.RadioButton();
this.radioButton2 = new System.Windows.Forms.RadioButton();
this.label3 = new System.Windows.Forms.Label();
this.button2 = new System.Windows.Forms.Button();
this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog();
this.SuspendLayout();
//
// textBox1
//
this.textBox1.Location = new System.Drawing.Point(12, 35);
this.textBox1.Name = "textBox1";
this.textBox1.Size = new System.Drawing.Size(258, 22);
this.textBox1.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(12, 15);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(46, 17);
this.label1.TabIndex = 1;
this.label1.Text = "Ikona:";
//
// button1
//
this.button1.Location = new System.Drawing.Point(273, 32);
this.button1.Name = "button1";
this.button1.Size = new System.Drawing.Size(110, 28);
this.button1.TabIndex = 2;
this.button1.Text = "Wybierz ikonę";
this.button1.UseVisualStyleBackColor = true;
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 60);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(80, 17);
this.label2.TabIndex = 3;
this.label2.Text = "Tytuł ikony:";
//
// textBox2
//
this.textBox2.Location = new System.Drawing.Point(12, 80);
this.textBox2.Name = "textBox2";
this.textBox2.Size = new System.Drawing.Size(371, 22);
this.textBox2.TabIndex = 4;
this.textBox2.Text = "Pokaż sztuczny błąd";
//
// radioButton1
//
this.radioButton1.AutoSize = true;
this.radioButton1.Checked = true;
this.radioButton1.Location = new System.Drawing.Point(15, 129);
this.radioButton1.Name = "radioButton1";
this.radioButton1.Size = new System.Drawing.Size(102, 21);
this.radioButton1.TabIndex = 5;
this.radioButton1.TabStop = true;
this.radioButton1.Text = "Pojedyncze";
this.radioButton1.UseVisualStyleBackColor = true;
//
// radioButton2
//
this.radioButton2.AutoSize = true;
this.radioButton2.Location = new System.Drawing.Point(124, 129);
this.radioButton2.Name = "radioButton2";
this.radioButton2.Size = new System.Drawing.Size(90, 21);
this.radioButton2.TabIndex = 6;
this.radioButton2.Text = "Podwójne";
this.radioButton2.UseVisualStyleBackColor = true;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(15, 109);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(138, 17);
this.label3.TabIndex = 7;
this.label3.Text = "Reaguj na kliknięcie:";
//
// button2
//
this.button2.Location = new System.Drawing.Point(273, 125);
this.button2.Name = "button2";
this.button2.Size = new System.Drawing.Size(110, 28);
this.button2.TabIndex = 8;
this.button2.Text = "Zapisz";
this.button2.UseVisualStyleBackColor = true;
this.button2.Click += new System.EventHandler(this.button2_Click);
//
// openFileDialog1
//
this.openFileDialog1.FileName = "openFileDialog1";
this.openFileDialog1.Filter = "Ikona (*.ico)|*.ico";
this.openFileDialog1.Title = "Wybierz ikonę powiadomienia";
//
// UstawieniaNotify
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(395, 165);
this.Controls.Add(this.button2);
this.Controls.Add(this.label3);
this.Controls.Add(this.radioButton2);
this.Controls.Add(this.radioButton1);
this.Controls.Add(this.textBox2);
this.Controls.Add(this.label2);
this.Controls.Add(this.button1);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox1);
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximumSize = new System.Drawing.Size(500, 300);
this.Name = "UstawieniaNotify";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Ustawienia Notify";
this.Load += new System.EventHandler(this.UstawieniaNotify_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox1;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox2;
private System.Windows.Forms.RadioButton radioButton1;
private System.Windows.Forms.RadioButton radioButton2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Button button2;
private System.Windows.Forms.OpenFileDialog openFileDialog1;
}
}
+59
View File
@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace ErrorGenerator
{
public partial class UstawieniaNotify : Form
{
static Properties.Settings settings = new Properties.Settings();
public UstawieniaNotify()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
if(openFileDialog1.ShowDialog() == DialogResult.OK)
{
textBox1.Text = openFileDialog1.FileName;
}
}
private void UstawieniaNotify_Load(object sender, EventArgs e)
{
textBox1.Text = settings.Ikona;
textBox2.Text = settings.TytulIkony;
if (settings.Klikniecie == 0)
{
radioButton1.Checked = true;
radioButton2.Checked = false;
}
else
{
radioButton1.Checked = false;
radioButton2.Checked = true;
}
}
private void button2_Click(object sender, EventArgs e)
{
settings.Ikona = textBox1.Text;
settings.TytulIkony = textBox2.Text;
if (radioButton1.Checked)
settings.Klikniecie = 0;
else
settings.Klikniecie = 1;
settings.Save();
MessageBox.Show("Ustawienia Notify zostały zapisane", "Zapisano!", MessageBoxButtons.OK, MessageBoxIcon.Information);
this.Close();
}
}
}
File diff suppressed because it is too large Load Diff
Binary file not shown.
+18
View File
@@ -1,6 +1,24 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<configSections>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="ErrorGenerator.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5"/>
</startup>
<userSettings>
<ErrorGenerator.Properties.Settings>
<setting name="Ikona" serializeAs="String">
<value />
</setting>
<setting name="TytulIkony" serializeAs="String">
<value>Pokaż sztuczny błąd</value>
</setting>
<setting name="Klikniecie" serializeAs="String">
<value>0</value>
</setting>
</ErrorGenerator.Properties.Settings>
</userSettings>
</configuration>
Binary file not shown.
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETFramework,Version=v4.5", FrameworkDisplayName = ".NET Framework 4.5")]
Binary file not shown.
Binary file not shown.
@@ -1 +1 @@
49ddf053a8af5d6e9369e6d3a8e96ccab85129ad
6df95db7fa056ded3a99796d97f33477a2f25dd4
@@ -8,3 +8,14 @@ C:\Users\Krzysiek\source\repos\ErrorGenerator\ErrorGenerator\bin\Debug\ErGen.exe
C:\Users\Krzysiek\source\repos\ErrorGenerator\ErrorGenerator\bin\Debug\ErGen.pdb
C:\Users\Krzysiek\source\repos\ErrorGenerator\ErrorGenerator\obj\Debug\ErGen.exe
C:\Users\Krzysiek\source\repos\ErrorGenerator\ErrorGenerator\obj\Debug\ErGen.pdb
C:\Users\Krzysiek\Documents\GitHub\ErGen\ErrorGenerator\bin\Debug\ErGen.exe.config
C:\Users\Krzysiek\Documents\GitHub\ErGen\ErrorGenerator\bin\Debug\ErGen.exe
C:\Users\Krzysiek\Documents\GitHub\ErGen\ErrorGenerator\bin\Debug\ErGen.pdb
C:\Users\Krzysiek\Documents\GitHub\ErGen\ErrorGenerator\obj\Debug\ErrorGenerator.csprojAssemblyReference.cache
C:\Users\Krzysiek\Documents\GitHub\ErGen\ErrorGenerator\obj\Debug\ErrorGenerator.Form1.resources
C:\Users\Krzysiek\Documents\GitHub\ErGen\ErrorGenerator\obj\Debug\ErrorGenerator.Properties.Resources.resources
C:\Users\Krzysiek\Documents\GitHub\ErGen\ErrorGenerator\obj\Debug\ErrorGenerator.csproj.GenerateResource.cache
C:\Users\Krzysiek\Documents\GitHub\ErGen\ErrorGenerator\obj\Debug\ErrorGenerator.csproj.CoreCompileInputs.cache
C:\Users\Krzysiek\Documents\GitHub\ErGen\ErrorGenerator\obj\Debug\ErGen.exe
C:\Users\Krzysiek\Documents\GitHub\ErGen\ErrorGenerator\obj\Debug\ErGen.pdb
C:\Users\Krzysiek\Documents\GitHub\ErGen\ErrorGenerator\obj\Debug\ErrorGenerator.UstawieniaNotify.resources