diff options
author | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2019-01-19 07:07:38 +0300 |
---|---|---|
committer | Mikayla Hutchinson <m.j.hutchinson@gmail.com> | 2019-01-19 13:36:05 +0300 |
commit | a463cbed00c36f89fc29b8ca3f0d74f484a62b72 (patch) | |
tree | 99bbeb9e6233c1b039122460e2ca97edaf1f0956 /main/src/core/MonoDevelop.Ide | |
parent | 334d430ff90f9a0683c0cc5e49f2d0a500838346 (diff) |
[Ide] Rename MimeTypes to MimeTypeCatalog
Diffstat (limited to 'main/src/core/MonoDevelop.Ide')
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs | 12 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj | 2 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs | 21 | ||||
-rw-r--r-- | main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MimeTypeCatalog.cs (renamed from main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/MimeTypes.cs) | 14 |
4 files changed, 27 insertions, 22 deletions
diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs index b04d7a09fe..2bd8411834 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/PlatformService.cs @@ -101,7 +101,7 @@ namespace MonoDevelop.Ide.Desktop public string GetMimeTypeForUri (string uri) { if (!String.IsNullOrEmpty (uri)) { - MimeTypeNode mt = MimeTypes.Instance.FindMimeTypeForFile (uri); + MimeTypeNode mt = MimeTypeCatalog.Instance.FindMimeTypeForFile (uri); if (mt != null) return mt.Id; } @@ -125,7 +125,7 @@ namespace MonoDevelop.Ide.Desktop return GettextCatalog.GetString ("Text file"); if (mimeType == "application/octet-stream") return GettextCatalog.GetString ("Unknown"); - MimeTypeNode mt = MimeTypes.Instance.FindMimeType (mimeType); + MimeTypeNode mt = MimeTypeCatalog.Instance.FindMimeType (mimeType); if (mt != null && mt.Description != null) return mt.Description; else @@ -146,7 +146,7 @@ namespace MonoDevelop.Ide.Desktop if (pic == null) { string mtype = GetMimeTypeForUri (filename); if (mtype != null) { - foreach (string mt in MimeTypes.Instance.GetMimeTypeInheritanceChain (mtype)) { + foreach (string mt in MimeTypeCatalog.Instance.GetMimeTypeInheritanceChain (mtype)) { pic = GetIconForType (mt); if (pic != null) return pic; @@ -162,7 +162,7 @@ namespace MonoDevelop.Ide.Desktop if (bf != null) return bf; - foreach (string type in MimeTypes.Instance.GetMimeTypeInheritanceChain (mimeType)) { + foreach (string type in MimeTypeCatalog.Instance.GetMimeTypeInheritanceChain (mimeType)) { // Try getting an icon name for the type string icon = GetIconIdForType (type); if (icon != null) { @@ -206,7 +206,7 @@ namespace MonoDevelop.Ide.Desktop string GetIconIdForFile (string fileName) { - MimeTypeNode mt = MimeTypes.Instance.FindMimeTypeForFile (fileName); + MimeTypeNode mt = MimeTypeCatalog.Instance.FindMimeTypeForFile (fileName); if (mt != null) return mt.Icon; else @@ -217,7 +217,7 @@ namespace MonoDevelop.Ide.Desktop { if (type == "text/plain") return "md-text-file-icon"; - MimeTypeNode mt = MimeTypes.Instance.FindMimeType (type); + MimeTypeNode mt = MimeTypeCatalog.Instance.FindMimeType (type); if (mt != null) return mt.Icon; else if (UsePlatformFileIcons) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj index e94d2d445e..6269e01745 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.csproj @@ -3042,7 +3042,7 @@ <Compile Include="MonoDevelop.Ide.Composition\SuggestedActionCategoryRegistryService.cs" /> <Compile Include="MonoDevelop.Ide.Composition\VacuousTextDataModel.cs" /> <Compile Include="MonoDevelop.Ide.Composition\VacuousTextViewModel.cs" /> - <Compile Include="MonoDevelop.Ide.Desktop\MimeTypes.cs" /> + <Compile Include="MonoDevelop.Ide\MimeTypeCatalog.cs" /> <Compile Include="MonoDevelop.Ide.Editor\ITextEditorInitializationService.cs" /> <Compile Include="MonoDevelop.Ide.Gui\DisplayBindingService.cs" /> <Compile Include="MonoDevelop.Ide.Gui\BackgroundProgressMonitor.cs" /> diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs index da802d3e68..e1ffc4319a 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/DesktopService.cs @@ -155,13 +155,22 @@ namespace MonoDevelop.Ide } public static string GetMimeTypeForRoslynLanguage (string roslynLanguage) - => MimeTypes.Instance.GetMimeTypeForRoslynLanguage (roslynLanguage); + => MimeTypeCatalog.Instance.GetMimeTypeForRoslynLanguage (roslynLanguage); public static IEnumerable<string> GetMimeTypeInheritanceChainForRoslynLanguage (string roslynLanguage) - => MimeTypes.Instance.GetMimeTypeInheritanceChainForRoslynLanguage (roslynLanguage); + => MimeTypeCatalog.Instance.GetMimeTypeInheritanceChainForRoslynLanguage (roslynLanguage); public static string GetRoslynLanguageForMimeType (string mimeType) - => MimeTypes.Instance.GetRoslynLanguageForMimeType (mimeType); + => MimeTypeCatalog.Instance.GetRoslynLanguageForMimeType (mimeType); + + public static string GetMimeTypeForContentType (string contentType) + => MimeTypeCatalog.Instance.GetMimeTypeForContentType (contentType); + + public static IEnumerable<string> GetMimeTypeInheritanceChainForContentType (string contentType) + => MimeTypeCatalog.Instance.GetMimeTypeInheritanceChainForContentType (contentType); + + public static string GetContentTypeForMimeType (string mimeType) + => MimeTypeCatalog.Instance.GetContentTypeForMimeType (mimeType); public static string GetMimeTypeForUri (string uri) { @@ -175,7 +184,7 @@ namespace MonoDevelop.Ide public static bool GetMimeTypeIsText (string mimeType) { - return MimeTypes.Instance.GetMimeTypeIsText (mimeType); + return MimeTypeCatalog.Instance.GetMimeTypeIsText (mimeType); } public static bool GetFileIsText (string file, string mimeType = null) @@ -220,12 +229,12 @@ namespace MonoDevelop.Ide public static bool GetMimeTypeIsSubtype (string subMimeType, string baseMimeType) { - return MimeTypes.Instance.GetMimeTypeIsSubtype (subMimeType, baseMimeType); + return MimeTypeCatalog.Instance.GetMimeTypeIsSubtype (subMimeType, baseMimeType); } public static IEnumerable<string> GetMimeTypeInheritanceChain (string mimeType) { - return MimeTypes.Instance.GetMimeTypeInheritanceChain (mimeType); + return MimeTypeCatalog.Instance.GetMimeTypeInheritanceChain (mimeType); } public static IEnumerable<string> GetMimeTypeInheritanceChainForFile (string filename) diff --git a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/MimeTypes.cs b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MimeTypeCatalog.cs index 03757227a5..8359fc833d 100644 --- a/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide.Desktop/MimeTypes.cs +++ b/main/src/core/MonoDevelop.Ide/MonoDevelop.Ide/MimeTypeCatalog.cs @@ -1,9 +1,5 @@ //
-// PlatformService.cs
-//
-// Author:
-// Geoff Norton <gnorton@novell.com>
-//
+// Copyright (C) Microsoft Corp.
// Copyright (C) 2007 Novell, Inc (http://www.novell.com)
//
// Permission is hereby granted, free of charge, to any person obtaining
@@ -32,18 +28,18 @@ using Mono.Addins; using MonoDevelop.Core;
using MonoDevelop.Ide.Extensions; -namespace MonoDevelop.Ide.Desktop +namespace MonoDevelop.Ide {
- class MimeTypes
+ class MimeTypeCatalog
{
- public static MimeTypes Instance { get; } = new MimeTypes ();
+ public static MimeTypeCatalog Instance { get; } = new MimeTypeCatalog ();
readonly MimeTypeNode textPlainNode = new MimeTypeNode ("text/plain", null, GettextCatalog.GetString ("Text document"), null, true, "text");
readonly MimeTypeNode xmlNode = new MimeTypeNode ("application/xml", null, GettextCatalog.GetString ("XML document"), null, true, null);
List<MimeTypeNode> mimeTypeNodes = new List<MimeTypeNode> ();
- MimeTypes ()
+ MimeTypeCatalog ()
{
if (AddinManager.IsInitialized) {
AddinManager.AddExtensionNodeHandler ("/MonoDevelop/Core/MimeTypes", delegate (object sender, ExtensionNodeEventArgs args) {
|