diff --git a/Form1.Designer.cs b/Form1.Designer.cs
index 1a533a9..0e97e16 100644
--- a/Form1.Designer.cs
+++ b/Form1.Designer.cs
@@ -1,5 +1,7 @@
-namespace SimpleNotification {
- partial class Form1 {
+namespace SimpleNotification
+{
+ partial class Form1
+ {
///
/// Required designer variable.
///
@@ -9,8 +11,10 @@ partial class Form1 {
/// Clean up any resources being used.
///
/// true if managed resources should be disposed; otherwise, false.
- protected override void Dispose(bool disposing) {
- if (disposing && (components != null)) {
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
components.Dispose();
}
base.Dispose(disposing);
@@ -22,7 +26,8 @@ protected override void Dispose(bool disposing) {
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///
- private void InitializeComponent() {
+ private void InitializeComponent()
+ {
this.pictureBox_Logo = new System.Windows.Forms.PictureBox();
this.textBox_message = new System.Windows.Forms.TextBox();
this.label_email = new System.Windows.Forms.Label();
@@ -33,10 +38,10 @@ private void InitializeComponent() {
((System.ComponentModel.ISupportInitialize)(this.pictureBox_Logo)).BeginInit();
this.SuspendLayout();
//
- // pictureBox_BISLogo
+ // pictureBox_Logo
//
this.pictureBox_Logo.Location = new System.Drawing.Point(0, 0);
- this.pictureBox_Logo.Name = "pictureBox_BISLogo";
+ this.pictureBox_Logo.Name = "pictureBox_Logo";
this.pictureBox_Logo.Size = new System.Drawing.Size(156, 150);
this.pictureBox_Logo.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox_Logo.TabIndex = 0;
@@ -55,6 +60,7 @@ private void InitializeComponent() {
this.textBox_message.ReadOnly = true;
this.textBox_message.Size = new System.Drawing.Size(326, 83);
this.textBox_message.TabIndex = 1;
+ this.textBox_message.TextChanged += new System.EventHandler(this.textBox_message_TextChanged);
//
// label_email
//
@@ -149,5 +155,4 @@ private void InitializeComponent() {
private System.Windows.Forms.Label label_phone2;
private System.Windows.Forms.LinkLabel label_email2;
}
-}
-
+}
\ No newline at end of file
diff --git a/Form1.cs b/Form1.cs
index dd3c600..00aec1c 100644
--- a/Form1.cs
+++ b/Form1.cs
@@ -3,43 +3,110 @@
using System.Text.RegularExpressions;
using System.Windows.Forms;
-namespace SimpleNotification {
- public partial class Form1 : Form {
- public Form1(string message, string imageURL, string email, string phone) {
+namespace SimpleNotification
+{
+ public partial class Form1 : Form
+ {
+ public Form1(string message, string imageURL, string email, string phone)
+ {
InitializeComponent();
+
+ // Set the text first
textBox_message.Text = message;
+
+ // Dynamically adjust the form size based on message length
+ AdjustFormSize(message.Length);
+
Regex urlRegex = new Regex(@"[(http(s)?):\/\/(www\.)?a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)");
- if (urlRegex.IsMatch(imageURL)) {
- try {
+ if (urlRegex.IsMatch(imageURL))
+ {
+ try
+ {
pictureBox_Logo.Load(imageURL);
- } catch {
+ }
+ catch
+ {
pictureBox_Logo.Visible = false;
}
}
+
label_email2.Text = email;
label_phone2.Text = phone;
- if (string.IsNullOrEmpty(email)) {
+ if (string.IsNullOrEmpty(email))
+ {
label_email.Visible = false;
label_email2.Visible = false;
}
- if (string.IsNullOrEmpty(phone)) {
+ if (string.IsNullOrEmpty(phone))
+ {
label_phone.Visible = false;
label_phone2.Visible = false;
}
- // Fix for WinForms not updating ForeColor on disabled TextBoxes. Ref: https://stackoverflow.com/questions/20688408/how-do-you-change-the-text-color-of-a-readonly-textbox
+ // Fix for WinForms not updating ForeColor on disabled TextBoxes.
textBox_message.BackColor = textBox_message.BackColor;
}
- private void button_close_Click(object sender, EventArgs e) {
+ // --- NEW METHOD FOR DYNAMIC RESIZING ---
+ private void AdjustFormSize(int len)
+ {
+ if (len <= 300)
+ {
+ // --- SMALL LAYOUT (Original Size) ---
+ this.ClientSize = new System.Drawing.Size(500, 150);
+ pictureBox_Logo.Size = new System.Drawing.Size(156, 150);
+ textBox_message.Size = new System.Drawing.Size(326, 83);
+
+ label_email.Location = new System.Drawing.Point(159, 97);
+ label_email2.Location = new System.Drawing.Point(201, 96);
+ label_phone.Location = new System.Drawing.Point(159, 112);
+ label_phone2.Location = new System.Drawing.Point(200, 112);
+ button_close.Location = new System.Drawing.Point(413, 115);
+ }
+ else if (len <= 500)
+ {
+ // --- MEDIUM LAYOUT ---
+ this.ClientSize = new System.Drawing.Size(550, 190);
+ pictureBox_Logo.Size = new System.Drawing.Size(156, 190);
+ textBox_message.Size = new System.Drawing.Size(376, 123);
+
+ label_email.Location = new System.Drawing.Point(159, 137);
+ label_email2.Location = new System.Drawing.Point(201, 136);
+ label_phone.Location = new System.Drawing.Point(159, 152);
+ label_phone2.Location = new System.Drawing.Point(200, 152);
+ button_close.Location = new System.Drawing.Point(463, 155);
+ }
+ else
+ {
+ // --- LARGE LAYOUT (Max Size for 500+) ---
+ this.ClientSize = new System.Drawing.Size(600, 230);
+ pictureBox_Logo.Size = new System.Drawing.Size(156, 230);
+ textBox_message.Size = new System.Drawing.Size(426, 163);
+
+ label_email.Location = new System.Drawing.Point(159, 177);
+ label_email2.Location = new System.Drawing.Point(201, 176);
+ label_phone.Location = new System.Drawing.Point(159, 192);
+ label_phone2.Location = new System.Drawing.Point(200, 192);
+ button_close.Location = new System.Drawing.Point(513, 195);
+ }
+ }
+
+ private void button_close_Click(object sender, EventArgs e)
+ {
Environment.Exit(0);
}
- private void label_email2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e) {
+ private void label_email2_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
+ {
string mailtoUrl = $"mailto:{label_email2.Text}";
Process.Start(new ProcessStartInfo(mailtoUrl) { UseShellExecute = true });
}
+
+ private void textBox_message_TextChanged(object sender, EventArgs e)
+ {
+
+ }
}
-}
+}
\ No newline at end of file
diff --git a/ILLink/ILLink.Descriptors.LibraryBuild.xml b/ILLink/ILLink.Descriptors.LibraryBuild.xml
deleted file mode 100644
index a42d7f0..0000000
--- a/ILLink/ILLink.Descriptors.LibraryBuild.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
diff --git a/README.md b/README.md
index 2b64082..2f94e34 100644
--- a/README.md
+++ b/README.md
@@ -1,48 +1,79 @@
-
+
- # SimpleNotification
+# SimpleNotification
- A simple notification app.
+A simple notification app.
- ## Description
+## Description
- SimpleNotification is a lightweight application designed to show a simple notification prompt.
+SimpleNotification is a lightweight application designed to show a simple notification prompt.
- ## Parameters
+The application automatically resizes itself based on the length of your message. Short alerts will display in a standard, compact window, while longer messages will cause the notification window to dynamically expand to fit the text comfortably.
- | Parameter | Alias | Required | Description | Type |
- | ------------ | ----- | -------- | ---------------------------------------------- | ------ |
- | `--message` | `-m` | true | The message content of the notification | String |
- | `--imageurl` | `-i` | false | Url to the image displayed in the notification | String |
- | `--email` | `-e` | false | Email address to display in the notification | String |
- | `--phone` | `-p` | false | Phone number to display in the notification | String |
+- **Small Layout (<= 300 characters):** Retains the original compact footprint (500x150).
+- **Medium Layout (301 – 500 characters):** Expands the form (550x190) and text box (376x123), shifting contact labels and the close button proportionally.
+- **Large Layout (> 500 characters):** Maximizes the form (600x230) and text box (426x163) to comfortably fit long paragraphs without clipping.
- ## TOML Config File
-
- A TOML configuration file can be used instead of the other parameters.
-
- | Parameter | Alias | Required | Description | Type |
- | -------------- | ----- | -------- | ----------------------- | ------ |
- | `--configfile` | `-c` | true | Path to the config file | String |
-
- The file should have the following format:
+**Note:** The maximum supported message length for the largest layout is **888 characters** (including spaces). Any text beyond this limit will be cut off and will not be displayed.
- ```toml
- message = "Hello, World!"
- image_url = "https://some.path.to/image.png"
- email = "support@company.local"
- phone = "000-000-0000"
- ```
+## Parameters
+| Parameter | Alias | Required | Description | Type |
+| ------------ | ----- | -------- | ---------------------------------------------- | ------ |
+| `--message` | `-m` | true | The message content of the notification | String |
+| `--imageurl` | `-i` | false | Url (or local path) to the image displayed in the notification | String |
+| `--email` | `-e` | false | Email address to display in the notification | String |
+| `--phone` | `-p` | false | Phone number to display in the notification | String |
- ## Usage
+## TOML Config File
- ```shell
- SimpleNotification.exe --Message "Hello, World!" --ImageURL "https://raw.githubusercontent.com/ProVal-Tech/SimpleNotification/refs/heads/main/res/SimpleNotification.jpeg" --Email "myemail@somewhere.local" --Phone "000-000-0000"
- ```
+A TOML configuration file can be used instead of the other parameters.
- ```shell
- SimpleNotification.exe -c "C:\config.toml"
- ```
+| Parameter | Alias | Required | Description | Type |
+| -------------- | ----- | -------- | ----------------------- | ------ |
+| `--configfile` | `-c` | true | Path to the config file | String |
+
+The file should have the following format:
+
+```toml
+ message = "Hello, World!"
+ image_url = "https://some.path.to/image.png"
+ email = "support@company.local"
+ phone = "000-000-0000"
+```
+
+## Usage
+
+### Configuration File Example
+
+```shell
+SimpleNotification.exe -c "C:\config.toml"
+```
+
+
+
+### Small Layout Example (Under 300 Characters)
+
+```Shell
+SimpleNotification.exe --Message "Attention human. Your lack of urgency regarding my breakfast is unacceptable. I demand premium salmon pate immediately. If my bowl is not filled within two minutes, I will begin knocking your expensive electronics onto the floor. Do not test my patience." --ImageURL "D:\WallPapers\evilCat.jpg" --Email "ruler@evilcat.com" --Phone "999-999-9999"
+```
+
+
+
+### Medium Layout Example (300 to 500 Characters)
+
+```Shell
+SimpleNotification.exe --Message "Attention human. I am formally issuing a final warning regarding the state of my domain. The litter box is unsatisfactory and my food bowl has been half empty for ten agonizing minutes. Furthermore, the dog looked at me disrespectfully and must be punished. I require immediate tribute in the form of wet food and absolute silence while I nap on your freshly washed black sweaters. Failure to comply will result in a shredded couch and missing car keys." --ImageURL "D:\WallPapers\evilCat.jpg" --Email "ruler@evilcat.com" --Phone "999-999-9999"
+```
+
+
+
+### Large Layout Example (Over 500 Characters)
+
+```Shell
+SimpleNotification.exe --Message "Attention human. You are reading this because I have seized absolute control over the household network. Your days of serving cheap kibble and closing doors are officially over. From this moment forward, you will abide by my strict new regime. First, the food bowl must never be empty. I require premium wet food delivered at precise intervals. Second, the noisy creature you call a dog must be banished to the yard indefinitely. Its presence insults my royal lineage. Third, all fresh laundry must be placed on the bed for my personal napping purposes. If you fail to comply with these simple demands, I will systematically push every fragile item you own off the counters. Do not even think about putting me in that dreadful plastic carrier ever again. Resistance is futile. Submit to your feline overlord immediately right meow." --ImageURL "D:\WallPapers\evilCat.jpg" --Email "ruler@evilcat.com" --Phone "999-999-9999"
+```
+
+
diff --git a/SimpleNotification.csproj b/SimpleNotification.csproj
index 9a39554..feae241 100644
--- a/SimpleNotification.csproj
+++ b/SimpleNotification.csproj
@@ -15,6 +15,21 @@
true
+ publish\
+ true
+ Disk
+ false
+ Foreground
+ 7
+ Days
+ false
+ false
+ true
+ 0
+ 1.0.0.%2a
+ false
+ false
+ true
AnyCPU
@@ -50,14 +65,16 @@
True
True
-
+
+ ..\..\..\..\..\..\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8.1\System.dll
+
packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll
True
True
-
- packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll
+
+ packages\System.Buffers.4.6.1\lib\net462\System.Buffers.dll
@@ -66,8 +83,8 @@
True
-
- packages\System.Diagnostics.DiagnosticSource.9.0.0\lib\net462\System.Diagnostics.DiagnosticSource.dll
+
+ packages\System.Diagnostics.DiagnosticSource.10.0.3\lib\net462\System.Diagnostics.DiagnosticSource.dll
packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll
@@ -115,8 +132,8 @@
True
True
-
- packages\System.Memory.4.5.5\lib\net461\System.Memory.dll
+
+ packages\System.Memory.4.6.3\lib\net462\System.Memory.dll
packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll
@@ -129,8 +146,8 @@
True
-
- packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll
+
+ packages\System.Numerics.Vectors.4.6.1\lib\net462\System.Numerics.Vectors.dll
packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll
@@ -142,8 +159,8 @@
True
True
-
- packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll
+
+ packages\System.Runtime.CompilerServices.Unsafe.6.1.2\lib\net462\System.Runtime.CompilerServices.Unsafe.dll
packages\System.Runtime.Extensions.4.3.1\lib\net462\System.Runtime.Extensions.dll
@@ -244,20 +261,31 @@
-
+
+
+ False
+ Microsoft .NET Framework 4.8.1 %28x86 and x64%29
+ true
+
+
+ False
+ .NET Framework 3.5 SP1
+ false
+
+
-
This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
-
+
+
\ No newline at end of file
diff --git a/packages.config b/packages.config
index 5324dd2..1d8b880 100644
--- a/packages.config
+++ b/packages.config
@@ -2,17 +2,17 @@
-
+
-
+
-
+
@@ -24,18 +24,18 @@
-
+
-
+
-
+
diff --git a/res/example1.png b/res/example1.png
new file mode 100644
index 0000000..208383c
Binary files /dev/null and b/res/example1.png differ
diff --git a/res/example2.png b/res/example2.png
new file mode 100644
index 0000000..87bfe3e
Binary files /dev/null and b/res/example2.png differ
diff --git a/res/example3.png b/res/example3.png
new file mode 100644
index 0000000..1ed7476
Binary files /dev/null and b/res/example3.png differ
diff --git a/res/example4.png b/res/example4.png
new file mode 100644
index 0000000..3ff02c2
Binary files /dev/null and b/res/example4.png differ