~halega/+junk/sharpdevelop

« back to all changes in this revision

Viewing changes to src/Libraries/AvalonEdit/ICSharpCode.AvalonEdit/Highlighting/Resources/Resources.cs

  • Committer: sk
  • Date: 2011-09-10 05:17:57 UTC
  • Revision ID: halega@halega.com-20110910051757-qfouz1llya9m6boy
4.1.0.7915 Release Candidate 1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Copyright (c) AlphaSierraPapa for the SharpDevelop Team (for details please see \doc\copyright.txt)
 
2
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
 
3
 
 
4
using System;
 
5
using System.IO;
 
6
 
 
7
namespace ICSharpCode.AvalonEdit.Highlighting
 
8
{
 
9
        static class Resources
 
10
        {
 
11
                static readonly string Prefix = typeof(Resources).FullName + ".";
 
12
                
 
13
                public static Stream OpenStream(string name)
 
14
                {
 
15
                        Stream s = typeof(Resources).Assembly.GetManifestResourceStream(Prefix + name);
 
16
                        if (s == null)
 
17
                                throw new FileNotFoundException("The resource file '" + name + "' was not found.");
 
18
                        return s;
 
19
                }
 
20
                
 
21
                internal static void RegisterBuiltInHighlightings(HighlightingManager.DefaultHighlightingManager hlm)
 
22
                {
 
23
                        hlm.RegisterHighlighting("XmlDoc", null, "XmlDoc.xshd");
 
24
                        hlm.RegisterHighlighting("C#", new[] { ".cs" }, "CSharp-Mode.xshd");
 
25
                        
 
26
                        hlm.RegisterHighlighting("JavaScript", new[] { ".js" }, "JavaScript-Mode.xshd");
 
27
                        hlm.RegisterHighlighting("HTML", new[] { ".htm", ".html" }, "HTML-Mode.xshd");
 
28
                        hlm.RegisterHighlighting("ASP/XHTML", new[] { ".asp", ".aspx", ".asax", ".asmx", ".ascx", ".master" }, "ASPX.xshd");
 
29
                        
 
30
                        hlm.RegisterHighlighting("Boo", new[] { ".boo" }, "Boo.xshd");
 
31
                        hlm.RegisterHighlighting("Coco", new[] { ".atg" }, "Coco-Mode.xshd");
 
32
                        hlm.RegisterHighlighting("CSS", new[] { ".css" }, "CSS-Mode.xshd");
 
33
                        hlm.RegisterHighlighting("C++", new[] { ".c", ".h", ".cc", ".cpp" , ".hpp" }, "CPP-Mode.xshd");
 
34
                        hlm.RegisterHighlighting("Java", new[] { ".java" }, "Java-Mode.xshd");
 
35
                        hlm.RegisterHighlighting("Patch", new[] { ".patch", ".diff" }, "Patch-Mode.xshd");
 
36
                        hlm.RegisterHighlighting("PHP", new[] { ".php" }, "PHP-Mode.xshd");
 
37
                        hlm.RegisterHighlighting("TeX", new[] { ".tex" }, "Tex-Mode.xshd");
 
38
                        hlm.RegisterHighlighting("VBNET", new[] { ".vb" }, "VBNET-Mode.xshd");
 
39
                        hlm.RegisterHighlighting("XML", (".xml;.xsl;.xslt;.xsd;.manifest;.config;.addin;" +
 
40
                                                         ".xshd;.wxs;.wxi;.wxl;.proj;.csproj;.vbproj;.ilproj;" +
 
41
                                                         ".booproj;.build;.xfrm;.targets;.xaml;.xpt;" +
 
42
                                                         ".xft;.map;.wsdl;.disco").Split(';'),
 
43
                                                 "XML-Mode.xshd");
 
44
                }
 
45
        }
 
46
}