Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Ungureanu <marius.ungureanu@xamarin.com>2016-07-04 17:50:49 +0300
committerMarius Ungureanu <marius.ungureanu@xamarin.com>2016-07-04 19:05:16 +0300
commit82e48b7c98ccf0dd65fee293b8687b0b41d52876 (patch)
tree07008bd0630419c16015bf6ba4939ca5682a7e11 /main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
parent4cf8d78fa4a6ed5c57f53b748812c7fe9f9e48a9 (diff)
[Ide] Optimize Menu popups
These command update handlers were doing too many GettextCatalog pinvokes on the same string. Optimize those out as they are invariant.
Diffstat (limited to 'main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs')
-rw-r--r--main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs9
1 files changed, 6 insertions, 3 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
index dfeea4fe2d..63f93482cf 100644
--- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
+++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Commands/FileCommands.cs
@@ -274,6 +274,7 @@ namespace MonoDevelop.Ide.Commands
return;
int i = 0;
+ var descFormat = GettextCatalog.GetString ("Open {0}");
foreach (var ri in files) {
string commandText = ri.DisplayName.Replace ("_", "__");
if (!Platform.IsMac) {
@@ -281,7 +282,7 @@ namespace MonoDevelop.Ide.Commands
commandText = acceleratorKeyPrefix + commandText;
}
var cmd = new CommandInfo (commandText) {
- Description = GettextCatalog.GetString ("Open {0}", ri.FileName)
+ Description = string.Format (descFormat, ri.FileName)
};
/* Gdk.Pixbuf icon = DesktopService.GetIconForFile (ri.FileName, IconSize.Menu);
#pragma warning disable 618
@@ -336,6 +337,8 @@ namespace MonoDevelop.Ide.Commands
return;
int i = 0;
+ var solutionFormat = GettextCatalog.GetString ("Load solution {0}");
+ var ctrlModText = GettextCatalog.GetString ("Hold Control to open in current workspace.");
foreach (var ri in projects) {
//getting the icon requires probing the file, so handle IO errors
IconId icon;
@@ -360,9 +363,9 @@ namespace MonoDevelop.Ide.Commands
commandText = acceleratorKeyPrefix + commandText;
}
- string str = GettextCatalog.GetString ("Load solution {0}", ri.ToString ());
+ string str = string.Format (solutionFormat, ri.ToString ());
if (IdeApp.Workspace.IsOpen)
- str += " - " + GettextCatalog.GetString ("Hold Control to open in current workspace.");
+ str += " - " + ctrlModText;
var cmd = new CommandInfo (commandText) {
Icon = icon,