Skip to content

Commit bdb3b00

Browse files
committed
Update exit confirmation dialog so that it shows the name of the currently opened file
1 parent c8bc87c commit bdb3b00

File tree

8 files changed

+11
-7
lines changed

8 files changed

+11
-7
lines changed
Binary file not shown.
0 Bytes
Binary file not shown.
-16.2 KB
Binary file not shown.
16.3 KB
Binary file not shown.

Text Editor Setup/Text Editor Setup-cache/part1/output-info.ini renamed to Text Editor Setup/Text Editor Setup-cache/part2/output-info.ini

1.42 KB
Binary file not shown.

Text Editor Setup/Text Editor Setup.aip

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<ROW Property="ARPCOMMENTS" Value="This installer database contains the logic and data required to install [|ProductName]." ValueLocId="*"/>
1212
<ROW Property="ARPPRODUCTICON" Value="icon72.exe" Type="8"/>
1313
<ROW Property="Manufacturer" Value="Zach, Inc."/>
14-
<ROW Property="ProductCode" Value="1033:{259CF9DB-508A-4DF2-8ED7-5E350DFE3DE1} " Type="16"/>
14+
<ROW Property="ProductCode" Value="1033:{86873AF7-4633-4D33-A9B1-DA2203060738} " Type="16"/>
1515
<ROW Property="ProductLanguage" Value="1033"/>
1616
<ROW Property="ProductName" Value="Text Editor"/>
17-
<ROW Property="ProductVersion" Value="1.1.0" Type="32"/>
17+
<ROW Property="ProductVersion" Value="1.1.1" Type="32"/>
1818
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND"/>
1919
<ROW Property="UpgradeCode" Value="{6F659083-3442-43A7-8DA3-D7192D778487}"/>
2020
<ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME" ValueLocId="-"/>
@@ -57,7 +57,7 @@
5757
<ROW BootstrOptKey="GlobalOptions" DownloadFolder="[AppDataFolder][|Manufacturer]\[|ProductName]\prerequisites" Options="2"/>
5858
</COMPONENT>
5959
<COMPONENT cid="caphyon.advinst.msicomp.BuildComponent">
60-
<ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFileName="Text_Editor_1_1_0_Setup" Languages="en" InstallationType="4" UseLargeSchema="true"/>
60+
<ROW BuildKey="DefaultBuild" BuildName="DefaultBuild" BuildOrder="1" BuildType="0" PackageFileName="Text_Editor_1_1_1_Setup" Languages="en" InstallationType="4" UseLargeSchema="true"/>
6161
</COMPONENT>
6262
<COMPONENT cid="caphyon.advinst.msicomp.DictionaryComponent">
6363
<ROW Path="&lt;AI_DICTS&gt;ui.ail"/>

Text Editor/AboutForm.Designer.cs

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Text Editor/Form1.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
using System.Windows.Forms;
1010
using System.IO;
1111
using System.Reflection;
12+
using System.Text.RegularExpressions;
1213

1314
namespace Text_Editor
1415
{
@@ -216,21 +217,24 @@ private void menuItem27_Click(object sender, EventArgs e)
216217

217218
private void mainEditor_TextChanged(object sender, EventArgs e)
218219
{
219-
if (!this.Text.Contains("*"))
220+
if (!this.Text.StartsWith("*"))
220221
{
221222
this.Text = "*" + this.Text;
222223
}
223224
}
224225

225226
private void Form1_FormClosing(object sender, FormClosingEventArgs e)
226227
{
227-
if (this.Text.Contains("*"))
228+
if (this.Text.StartsWith("*"))
228229
{
229230

230231
switch (e.CloseReason)
231232
{
232233
case CloseReason.UserClosing:
233-
DialogResult dr = MessageBox.Show("Your file has unsaved changes. Do you want to save them?", "Unsaved changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
234+
string fileNameOld = this.Text.Replace(" - Text Editor", "");
235+
var regex = new Regex(Regex.Escape("*"));
236+
string fileName = regex.Replace(fileNameOld, "", 1);
237+
DialogResult dr = MessageBox.Show(fileName + " has unsaved changes. Do you want to save them?", "Unsaved changes", MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question);
234238
if (dr == DialogResult.Yes)
235239
{
236240
this.menuItem5.PerformClick();

0 commit comments

Comments
 (0)