Skip to content

Commit 7de577c

Browse files
committed
Rename resource string
1 parent 62e18db commit 7de577c

File tree

7 files changed

+35
-35
lines changed

7 files changed

+35
-35
lines changed

PasteIntoFile/ClipboardContents.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public override void SaveAs(string path, string extension) {
7979
XImage img = XImage.FromStream(stream);
8080
// create pdf document
8181
PdfDocument document = new PdfDocument();
82-
document.Info.Creator = Resources.str_main_window_title;
82+
document.Info.Creator = Resources.app_title;
8383
PdfPage page = document.AddPage();
8484
page.Width = XUnit.FromPoint(img.PointWidth);
8585
page.Height = XUnit.FromPoint(img.PointHeight);

PasteIntoFile/Dialog.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public Dialog(string location = null, bool forceShowDialog = false) {
4343
element.Text = Resources.ResourceManager.GetString(element.Text) ?? element.Text;
4444
}
4545

46-
Icon = Resources.icon;
47-
Text = Resources.str_main_window_title;
46+
Icon = Resources.app_icon;
47+
Text = Resources.app_title;
4848
infoLabel.Text = string.Format(Resources.str_version, ProductVersion);
4949

5050

@@ -167,7 +167,7 @@ private bool readClipboard() {
167167
return true;
168168
}
169169

170-
MessageBox.Show(Resources.str_noclip_text, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
170+
MessageBox.Show(Resources.str_noclip_text, Resources.app_title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
171171
return false;
172172

173173
}
@@ -279,13 +279,13 @@ string save() {
279279

280280
// check if file exists
281281
if (File.Exists(file)) {
282-
var result = MessageBox.Show(string.Format(Resources.str_file_exists, file), Resources.str_main_window_title,
282+
var result = MessageBox.Show(string.Format(Resources.str_file_exists, file), Resources.app_title,
283283
MessageBoxButtons.YesNo, MessageBoxIcon.Warning);
284284
if (result != DialogResult.Yes) {
285285
return null;
286286
}
287287
} else if (Directory.Exists(file)) {
288-
MessageBox.Show(string.Format(Resources.str_file_exists_directory, file), Resources.str_main_window_title,
288+
MessageBox.Show(string.Format(Resources.str_file_exists_directory, file), Resources.app_title,
289289
MessageBoxButtons.OK, MessageBoxIcon.Error);
290290
return null;
291291
}
@@ -310,10 +310,10 @@ string save() {
310310
return file;
311311

312312
} catch (UnauthorizedAccessException ex) {
313-
MessageBox.Show(ex.Message + "\n" + Resources.str_message_run_as_admin, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
313+
MessageBox.Show(ex.Message + "\n" + Resources.str_message_run_as_admin, Resources.app_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
314314
Program.RestartAppElevated(txtCurrentLocation.Text);
315315
} catch (Exception ex) {
316-
MessageBox.Show(ex.Message, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
316+
MessageBox.Show(ex.Message, Resources.app_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
317317
}
318318

319319
return null;

PasteIntoFile/Main.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,10 +163,10 @@ static int RunCopy(ArgsCopy args) {
163163
}
164164

165165
MessageBox.Show(String.Format(Resources.str_copy_failed_unknown_format, path),
166-
Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
166+
Resources.app_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
167167

168168
} catch (Exception ex) {
169-
MessageBox.Show(ex.Message, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
169+
MessageBox.Show(ex.Message, Resources.app_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
170170
}
171171

172172
return 1;
@@ -217,15 +217,15 @@ static int RunTray(ArgsTray args = null) {
217217
arg.FilePath = files.Item(0).Path;
218218
RunCopy(arg);
219219
} else {
220-
MessageBox.Show(Resources.str_copy_failed_not_single_file, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
220+
MessageBox.Show(Resources.str_copy_failed_not_single_file, Resources.app_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
221221
}
222222
};
223223
copy.RegisterHotKey(ModifierKeys.Win | ModifierKeys.Alt, Keys.C);
224224

225225
// Tray icon
226226
NotifyIcon icon = new NotifyIcon();
227-
icon.Icon = Resources.icon;
228-
icon.Text = Resources.str_main_window_title;
227+
icon.Icon = Resources.app_icon;
228+
icon.Text = Resources.app_title;
229229
icon.ContextMenu = new ContextMenu(new[] {
230230
new MenuItem(Resources.str_open_paste_into_file, (s, e) => new Dialog(forceShowDialog: true).Show()),
231231
new MenuItem(Resources.str_settings, (s, e) => new Wizard().Show()),

PasteIntoFile/Properties/Resources.Designer.cs

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PasteIntoFile/Properties/Resources.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119119
</resheader>
120120
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
121-
<data name="icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
121+
<data name="app_icon" type="System.Resources.ResXFileRef, System.Windows.Forms">
122122
<value>..\Resources\icon.ico;System.Drawing.Icon, System.Drawing, Version=4.0.0.0, Culture=neutral</value>
123123
</data>
124124
<data name="str_save" xml:space="preserve">
@@ -133,7 +133,7 @@
133133
<data name="str_location" xml:space="preserve">
134134
<value>Location</value>
135135
</data>
136-
<data name="str_main_window_title" xml:space="preserve">
136+
<data name="app_title" xml:space="preserve">
137137
<value>Paste Into File</value>
138138
</data>
139139
<data name="str_message_unregister_context_menu_success" xml:space="preserve">

PasteIntoFile/TemplateEdit.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public TemplateEdit() {
1616
element.Text = Resources.ResourceManager.GetString(element.Text) ?? element.Text;
1717
}
1818

19-
Icon = Resources.icon;
19+
Icon = Resources.app_icon;
2020
Text = Resources.str_edit_template;
2121

2222
// setup link in info text

PasteIntoFile/Wizard.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ public Wizard() {
1414
element.Text = Resources.ResourceManager.GetString(element.Text) ?? element.Text;
1515
}
1616

17-
Icon = Resources.icon;
18-
Text = Resources.str_main_window_title;
17+
Icon = Resources.app_icon;
18+
Text = Resources.app_title;
1919

2020
version.Text = string.Format(Resources.str_version, ProductVersion);
2121

@@ -40,27 +40,27 @@ private void ChkContextEntry_CheckedChanged(object sender, EventArgs e) {
4040
try {
4141
if (contextEntryCheckBox.Checked && !RegistryUtil.IsContextMenuEntryRegistered()) {
4242
RegistryUtil.RegisterContextMenuEntry(!Settings.Default.autoSave);
43-
MessageBox.Show(Resources.str_message_register_context_menu_success, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Information);
43+
MessageBox.Show(Resources.str_message_register_context_menu_success, Resources.app_title, MessageBoxButtons.OK, MessageBoxIcon.Information);
4444
} else if (!contextEntryCheckBox.Checked && RegistryUtil.IsContextMenuEntryRegistered()) {
4545
RegistryUtil.UnRegisterContextMenuEntry();
46-
MessageBox.Show(Resources.str_message_unregister_context_menu_success, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Information);
46+
MessageBox.Show(Resources.str_message_unregister_context_menu_success, Resources.app_title, MessageBoxButtons.OK, MessageBoxIcon.Information);
4747
}
4848
} catch (Exception ex) {
49-
MessageBox.Show(ex.Message + "\n" + Resources.str_message_run_as_admin, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
49+
MessageBox.Show(ex.Message + "\n" + Resources.str_message_run_as_admin, Resources.app_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
5050
}
5151
}
5252

5353
private void ChkAutostart_CheckedChanged(object sender, EventArgs e) {
5454
try {
5555
if (autostartCheckBox.Checked && !RegistryUtil.IsAutostartRegistered()) {
5656
RegistryUtil.RegisterAutostart();
57-
MessageBox.Show(Resources.str_message_register_autostart_success, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Information);
57+
MessageBox.Show(Resources.str_message_register_autostart_success, Resources.app_title, MessageBoxButtons.OK, MessageBoxIcon.Information);
5858
} else if (!autostartCheckBox.Checked && RegistryUtil.IsAutostartRegistered()) {
5959
RegistryUtil.UnRegisterAutostart();
60-
MessageBox.Show(Resources.str_message_unregister_autostart_success, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Information);
60+
MessageBox.Show(Resources.str_message_unregister_autostart_success, Resources.app_title, MessageBoxButtons.OK, MessageBoxIcon.Information);
6161
}
6262
} catch (Exception ex) {
63-
MessageBox.Show(ex.Message + "\n" + Resources.str_message_run_as_admin, Resources.str_main_window_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
63+
MessageBox.Show(ex.Message + "\n" + Resources.str_message_run_as_admin, Resources.app_title, MessageBoxButtons.OK, MessageBoxIcon.Error);
6464
}
6565
}
6666

0 commit comments

Comments
 (0)