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:
Diffstat (limited to 'main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs')
-rw-r--r--main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs16
1 files changed, 14 insertions, 2 deletions
diff --git a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs
index 2c36b575ca..0b74632ea2 100644
--- a/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs
+++ b/main/src/core/Mono.Texteditor/Mono.TextEditor.Highlighting/SyntaxModeService.cs
@@ -92,13 +92,24 @@ namespace Mono.TextEditor.Highlighting
return styleLookup[style.Name];
return null;
}
-
+
+ public static string GetFileName (string name)
+ {
+ if (!styleLookup.ContainsKey (name))
+ throw new System.ArgumentException ("Style " + name + " not found", "name");
+ var provider = styleLookup [name];
+ if (provider is UrlStreamProvider) {
+ var usp = provider as UrlStreamProvider;
+ return usp.Url;
+ }
+ return null;
+ }
+
static void LoadStyle (string name)
{
if (!styleLookup.ContainsKey (name))
throw new System.ArgumentException ("Style " + name + " not found", "name");
var provider = styleLookup [name];
- styleLookup.Remove (name);
var stream = provider.Open ();
try {
if (provider is UrlStreamProvider) {
@@ -112,6 +123,7 @@ namespace Mono.TextEditor.Highlighting
} else {
styles [name] = ColorScheme.LoadFrom (stream);
}
+ styleLookup.Remove (name);
} catch (Exception e) {
throw new IOException ("Error while loading style :" + name, e);
} finally {