[Monodevelop-patches-list] r2056 - in trunk/MonoDevelop/Core/src/Main/Base: . Commands Commands/ProjectBrowserCommands Internal/Codons Internal/Codons/LanguageBinding Internal/Codons/MenuItems Internal/Conditions Internal/ExternalTool Internal/Parser/ReflectionLayer Internal/Project/Combine Internal/Project/Project Internal/Project/Project/Deployment Internal/Templates Internal/Templates/ProjectTemplates Services Services/AmbienceService Services/MenuService Services/ParserService Services/Project Services/StatusBar Services/Tasks Services/Toolbar

commit-watcher at mono-cvs.ximian.com commit-watcher at mono-cvs.ximian.com
Mon Dec 6 12:00:46 EST 2004


Author: lluis
Date: 2004-12-06 12:00:46 -0500 (Mon, 06 Dec 2004)
New Revision: 2056

Modified:
   trunk/MonoDevelop/Core/src/Main/Base/ChangeLog
   trunk/MonoDevelop/Core/src/Main/Base/Commands/AutostartCommands.cs
   trunk/MonoDevelop/Core/src/Main/Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Codons/DialogPanelCodon.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Codons/LanguageBinding/FileFilterCodon.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Codons/MenuItems/MenuItemCodon.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Conditions/CombineOpenCondition.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Conditions/ProjectActiveCondition.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Conditions/ProjectOpenCondition.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/ExternalTool/ToolLoader.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Parser/ReflectionLayer/ReflectionClass.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Combine/Combine.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Combine/CombineEntry.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/AbstractProject.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/Deployment/AssemblyDeploy.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/Deployment/FileDeploy.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/Deployment/ScriptDeploy.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/IncludeFilesDialog.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/ProjectReference.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/CodeTemplateLoader.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/FileTemplate.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/ProjectTemplates/CombineDescriptor.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/ProjectTemplates/ProjectDescriptor.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/ProjectTemplates/ProjectTemplate.cs
   trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/TextTemplate.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/AmbienceService/AmbienceService.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/AmbienceService/CodeDOMGeneratorUtility.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/MenuService/MenuService.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/MessageService.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/ParserService/DefaultParserService.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/Project/DefaultProjectService.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/StatusBar/DefaultStatusBarService.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/Tasks/Task.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/Tasks/TaskService.cs
   trunk/MonoDevelop/Core/src/Main/Base/Services/Toolbar/ToolbarService.cs
Log:
	* *.cs: Removed remaining calls to ServiceManager.GetService.



Modified: trunk/MonoDevelop/Core/src/Main/Base/ChangeLog
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/ChangeLog	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/ChangeLog	2004-12-06 17:00:46 UTC (rev 2056)
@@ -1,5 +1,9 @@
 2004-12-06  Lluis Sanchez Gual  <lluis at novell.com>
 
+	* *.cs: Removed remaining calls to ServiceManager.GetService.
+
+2004-12-06  Lluis Sanchez Gual  <lluis at novell.com>
+
 	* Services/Runtime.cs: Root class that gives access to all services.
 	* Gui/GuiService.cs: Root class that gives access to some gui-related
 	services.

Modified: trunk/MonoDevelop/Core/src/Main/Base/Commands/AutostartCommands.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Commands/AutostartCommands.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Commands/AutostartCommands.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -53,7 +53,7 @@
 			
 			// load previous combine
 			if ((bool)Runtime.Properties.GetProperty("SharpDevelop.LoadPrevProjectOnStartup", false)) {
-	                        RecentOpen recentOpen = ((IFileService)MonoDevelop.Core.Services.ServiceManager.GetService (typeof (IFileService))).RecentOpen;
+				RecentOpen recentOpen = Runtime.FileService.RecentOpen;
 
 				if (recentOpen.RecentProject != null && recentOpen.RecentProject.Length > 0) { 
 					Runtime.ProjectService.OpenCombine(recentOpen.RecentProject[0].ToString());

Modified: trunk/MonoDevelop/Core/src/Main/Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Commands/ProjectBrowserCommands/CombineNodeCommands.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -103,11 +103,9 @@
 		{
 			ProjectBrowserView browser = (ProjectBrowserView)Owner;
 			CombineBrowserNode node    = browser.SelectedNode as CombineBrowserNode;
-			PropertyService propertyService = (PropertyService)ServiceManager.GetService (typeof (PropertyService));
 			
 			if (node != null) {
 				using (FileSelector fdiag = new FileSelector (GettextCatalog.GetString ("Add a Project"))) {
-					StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
 					fdiag.SelectMultiple = false;
 					if (fdiag.Run () == (int) Gtk.ResponseType.Ok) {
 						try {
@@ -143,12 +141,9 @@
 		{
 			ProjectBrowserView browser = (ProjectBrowserView)Owner;
 			CombineBrowserNode node    = browser.SelectedNode as CombineBrowserNode;
-			PropertyService propertyService = (PropertyService)ServiceManager.GetService (typeof (PropertyService));
 			
 			if (node != null) {
 				using (FileSelector fdiag = new FileSelector (GettextCatalog.GetString ("Add a Combine"))) {
-					StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
-				
 					fdiag.SelectMultiple = false;
 					if (fdiag.Run () == (int) Gtk.ResponseType.Ok) {
 						try {

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Codons/DialogPanelCodon.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Codons/DialogPanelCodon.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Codons/DialogPanelCodon.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -37,7 +37,6 @@
 		public override object BuildItem(object owner, ArrayList subItems, ConditionCollection conditions)
 		{
 			IDialogPanelDescriptor newItem = null;
-			StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
 			
 			if (subItems == null || subItems.Count == 0) {				
 				if (Class != null) {

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Codons/LanguageBinding/FileFilterCodon.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Codons/LanguageBinding/FileFilterCodon.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Codons/LanguageBinding/FileFilterCodon.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -10,7 +10,7 @@
 
 using MonoDevelop.Core.Properties;
 using MonoDevelop.Core.AddIns.Conditions;
-using MonoDevelop.Core.Services;
+using MonoDevelop.Services;
 
 namespace MonoDevelop.Core.AddIns.Codons
 {
@@ -50,8 +50,7 @@
 			if (subItems.Count > 0) {
 				throw new ApplicationException("more than one level of file filters don't make sense!");
 			}
-			StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
-			return stringParserService.Parse(filtername) + "|" + String.Join(";", extensions);
+			return Runtime.StringParserService.Parse(filtername) + "|" + String.Join(";", extensions);
 		}
 	}
 }

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Codons/MenuItems/MenuItemCodon.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Codons/MenuItems/MenuItemCodon.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Codons/MenuItems/MenuItemCodon.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -139,8 +139,7 @@
 			Debug.Assert(newItem != null);
 			
 			if (Icon != null && newItem is SdMenuCommand) {
-				ResourceService resourceService = (ResourceService)ServiceManager.GetService(typeof(ResourceService));
-				((SdMenuCommand)newItem).Image = resourceService.GetImage(Icon, Gtk.IconSize.Menu);
+				((SdMenuCommand)newItem).Image = Runtime.Gui.Resources.GetImage(Icon, Gtk.IconSize.Menu);
 			}
 			
 			if (newItem is SdMenuCommand) {

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Conditions/CombineOpenCondition.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Conditions/CombineOpenCondition.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Conditions/CombineOpenCondition.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -33,8 +33,7 @@
 		
 		public override bool IsValid(object owner)
 		{
-			IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
-			return projectService.CurrentOpenCombine != null || !isCombineOpen;
+			return Runtime.ProjectService.CurrentOpenCombine != null || !isCombineOpen;
 		}
 	}
 }

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Conditions/ProjectActiveCondition.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Conditions/ProjectActiveCondition.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Conditions/ProjectActiveCondition.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -36,8 +36,7 @@
 		
 		public override bool IsValid(object owner)
 		{
-			IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
-			IProject project = projectService.CurrentSelectedProject;
+			IProject project = Runtime.ProjectService.CurrentSelectedProject;
 			
 			if (activeproject == "*") {
 				return project != null;

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Conditions/ProjectOpenCondition.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Conditions/ProjectOpenCondition.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Conditions/ProjectOpenCondition.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -36,11 +36,10 @@
 		
 		public override bool IsValid(object owner)
 		{
-			IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
-			IProject project = projectService.CurrentSelectedProject;
+			IProject project = Runtime.ProjectService.CurrentSelectedProject;
 			
-			if (project == null && projectService.CurrentOpenCombine != null) {
-				ArrayList projects = Combine.GetAllProjects(projectService.CurrentOpenCombine);
+			if (project == null && Runtime.ProjectService.CurrentOpenCombine != null) {
+				ArrayList projects = Combine.GetAllProjects(Runtime.ProjectService.CurrentOpenCombine);
 				if (projects.Count > 0) {
 					project = ((ProjectCombineEntry)projects[0]).Project;
 				}

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/ExternalTool/ToolLoader.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/ExternalTool/ToolLoader.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/ExternalTool/ToolLoader.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -67,8 +67,7 @@
 				doc.DocumentElement.AppendChild(et.ToXmlElement(doc));
 			}
 			
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
-			fileUtilityService.ObservedSave(new NamedFileOperationDelegate(doc.Save), fileName, FileErrorPolicy.ProvideAlternative);
+			Runtime.FileUtilityService.ObservedSave(new NamedFileOperationDelegate(doc.Save), fileName, FileErrorPolicy.ProvideAlternative);
 		}
 		
 		/// <summary>
@@ -77,16 +76,12 @@
 		/// </summary>
 		static ToolLoader()
 		{
-			PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
-		
-			if (!LoadToolsFromStream(propertyService.ConfigDirectory + TOOLFILE)) {
+			if (!LoadToolsFromStream (Runtime.Properties.ConfigDirectory + TOOLFILE)) {
 				//Console.WriteLine("Tools: can't load user defaults, reading system defaults");
-				if (!LoadToolsFromStream(propertyService.DataDirectory +
+				if (!LoadToolsFromStream (Runtime.Properties.DataDirectory +
 				                         Path.DirectorySeparatorChar + "options" + 
 				                         Path.DirectorySeparatorChar + TOOLFILE)) {
-					IMessageService messageService = (IMessageService)ServiceManager.GetService(typeof(IMessageService));
-					messageService.ShowWarning(GettextCatalog.GetString ("Can't load external tools configuration file"));
+					Runtime.MessageService.ShowWarning(GettextCatalog.GetString ("Can't load external tools configuration file"));
 				}
 			}
 		}
@@ -97,8 +92,7 @@
 		/// </summary>
 		public static void SaveTools()
 		{
-			PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-			WriteToolsToFile(propertyService.ConfigDirectory + TOOLFILE);
+			WriteToolsToFile (Runtime.Properties.ConfigDirectory + TOOLFILE);
 		}
 	}
 }

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Parser/ReflectionLayer/ReflectionClass.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Parser/ReflectionLayer/ReflectionClass.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Parser/ReflectionLayer/ReflectionClass.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -49,8 +49,7 @@
 
 			FullyQualifiedName = type.FullName;
 
-			MonodocService docservice = ((MonodocService)ServiceManager.GetService (typeof (MonodocService)));
-			XmlDocument docs = docservice != null ? docservice.GetHelpXml (FullyQualifiedName) : null;
+			XmlDocument docs = Runtime.Documentation != null ? Runtime.Documentation.GetHelpXml (FullyQualifiedName) : null;
 			if (docs != null) {
 				XmlNode node = docs.SelectSingleNode ("/Type/Docs/summary");
 				if (node != null) {

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Combine/Combine.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Combine/Combine.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Combine/Combine.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -199,13 +199,9 @@
 		
 		public IProject LoadProject(string filename)
 		{
-			LanguageBindingService languageBindingService = (LanguageBindingService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(LanguageBindingService));
-			StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
-			
-			ILanguageBinding binding = languageBindingService.GetBindingPerProjectFile(filename);
+			ILanguageBinding binding = Runtime.Languages.GetBindingPerProjectFile(filename);
 			if (binding == null) {
-				IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-				messageService.ShowError(String.Format (GettextCatalog.GetString ("Can't find language binding for {0}"), filename));
+				Runtime.MessageService.ShowError(String.Format (GettextCatalog.GetString ("Can't find language binding for {0}"), filename));
 				return null;
 			}
 			
@@ -230,7 +226,7 @@
 			
 			XmlNodeList nodes = root["Entries"].ChildNodes;
 			entries.Clear();
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
+			FileUtilityService fileUtilityService = Runtime.FileUtilityService;
 			eventsAllowed = false;
 			try {
 				foreach (XmlElement el in nodes) {
@@ -330,7 +326,7 @@
 			doc.DocumentElement.AppendChild(startupnode);
 						
 			XmlElement projectsnode = doc.CreateElement("Entries");
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
+			FileUtilityService fileUtilityService = Runtime.FileUtilityService;
 			
 			foreach (CombineEntry entry in entries) {
 				XmlElement el = doc.CreateElement("Entry");
@@ -380,8 +376,7 @@
 				if (fdiag.Run() == (int)Gtk.ResponseType.Ok) {
 					string filename = fdiag.Filename;
 					SaveCombine(filename);
-					IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-					messageService.ShowMessage(filename, GettextCatalog.GetString ("Combine saved"));
+					Runtime.MessageService.ShowMessage(filename, GettextCatalog.GetString ("Combine saved"));
 				}
 				
 				fdiag.Hide ();
@@ -626,14 +621,12 @@
 			try {
 				allProjects = TopologicalSort(allProjects);
 			} catch (CyclicBuildOrderException) {
-				IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-				messageService.ShowError(GettextCatalog.GetString ("Cyclic dependencies can not be built with this version.\nBut we are working on it."));
+				Runtime.MessageService.ShowError(GettextCatalog.GetString ("Cyclic dependencies can not be built with this version.\nBut we are working on it."));
 				return;
 			}
-			TaskService taskService = (TaskService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(TaskService));
 			foreach (ProjectCombineEntry entry in allProjects) {
 				entry.Build(doBuildAll);
-				if (taskService.Errors > 0) {
+				if (Runtime.TaskService.Errors > 0) {
 					break;
 				}
 			}
@@ -652,7 +645,7 @@
 					Console.WriteLine ("Dont know how to generate makefiles for " + entry);
 			}
 			
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
+			FileUtilityService fileUtilityService = Runtime.FileUtilityService;
 			string rel_outputdir = fileUtilityService.AbsoluteToRelativePath (path, outputdir);
 			
 			StreamWriter buildstream = new StreamWriter (Path.Combine (path, "make.sh"));

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Combine/CombineEntry.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Combine/CombineEntry.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Combine/CombineEntry.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -106,14 +106,10 @@
 		public override void Build(bool doBuildAll)
 		{ // if you change something here look at the DefaultProjectService BeforeCompile method
 			if (doBuildAll || isDirty) {
-				StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
-				stringParserService.Properties["Project"] = Name;
-				IProjectService   projectService   = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
-				IStatusBarService statusBarService = (IStatusBarService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IStatusBarService));
-				TaskService       taskService      = (TaskService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(TaskService));
+				Runtime.StringParserService.Properties["Project"] = Name;
+				TaskService taskService = Runtime.TaskService;
 				
-				statusBarService.SetMessage(String.Format (GettextCatalog.GetString ("Compiling: {0}"), Project.Name));
-				LanguageBindingService languageBindingService = (LanguageBindingService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(LanguageBindingService));
+				Runtime.Gui.StatusBar.SetMessage(String.Format (GettextCatalog.GetString ("Compiling: {0}"), Project.Name));
 				
 				// create output directory, if not exists
 				string outputDir = ((AbstractProjectConfiguration)project.ActiveConfiguration).OutputDirectory;
@@ -126,7 +122,7 @@
 					throw new ApplicationException("Can't create project output directory " + outputDir + " original exception:\n" + e.ToString());
 				}
 				
-				ILanguageBinding csc = languageBindingService.GetBindingPerLanguageName(project.ProjectType);
+				ILanguageBinding csc = Runtime.Languages.GetBindingPerLanguageName(project.ProjectType);
 				
 				AbstractProjectConfiguration conf = project.ActiveConfiguration as AbstractProjectConfiguration;
 
@@ -176,15 +172,13 @@
 		
 		public override void Execute()
 		{
-			LanguageBindingService languageBindingService = (LanguageBindingService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(LanguageBindingService));
-			ILanguageBinding binding = languageBindingService.GetBindingPerLanguageName(project.ProjectType);
+			ILanguageBinding binding = Runtime.Languages.GetBindingPerLanguageName(project.ProjectType);
 			if (binding == null) {
 				throw new ApplicationException("can't find language binding for project ");
 			}
-			TaskService taskService = (TaskService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(TaskService));
 			
-			if (taskService.Errors == 0) {
-				if (taskService.Warnings == 0 || project.ActiveConfiguration != null && ((AbstractProjectConfiguration)project.ActiveConfiguration).RunWithWarnings) {
+			if (Runtime.TaskService.Errors == 0) {
+				if (Runtime.TaskService.Warnings == 0 || project.ActiveConfiguration != null && ((AbstractProjectConfiguration)project.ActiveConfiguration).RunWithWarnings) {
 					project.CopyReferencesToOutputPath (true);
 					binding.Execute(project);
 				}
@@ -194,15 +188,12 @@
 
 		public override void Debug ()
 		{
-			LanguageBindingService langBindingServ = (LanguageBindingService)MonoDevelop.Core.Services.ServiceManager.GetService (typeof (LanguageBindingService));
-			ILanguageBinding binding = langBindingServ.GetBindingPerLanguageName (project.ProjectType);
+			ILanguageBinding binding = Runtime.Languages.GetBindingPerLanguageName (project.ProjectType);
 			if (binding == null) {
 				Console.WriteLine ("Language binding unknown");
 				return;
 			}
-			TaskService taskService = (TaskService)MonoDevelop.Core.Services.ServiceManager.GetService (typeof (TaskService));
-
-			if (taskService.Errors == 0)
+			if (Runtime.TaskService.Errors == 0)
 				binding.DebugProject (project);
 		}
 		
@@ -214,15 +205,13 @@
 		public override void GenerateMakefiles (Combine parentCombine)
 		{
 			Console.WriteLine ("Generating makefiles for " + Name);
-			LanguageBindingService languageBindingService = (LanguageBindingService)ServiceManager.GetService(typeof(LanguageBindingService));
-			ILanguageBinding langBinding = languageBindingService.GetBindingPerLanguageName(project.ProjectType);
+			ILanguageBinding langBinding = Runtime.Languages.GetBindingPerLanguageName(project.ProjectType);
 			langBinding.GenerateMakefile (project, parentCombine);
 		}
 
 		public override string GetOutputName ()
 		{
-			LanguageBindingService lbs = (LanguageBindingService)ServiceManager.GetService (typeof (LanguageBindingService));
-			ILanguageBinding langBinding = lbs.GetBindingPerLanguageName (project.ProjectType);
+			ILanguageBinding langBinding = Runtime.Languages.GetBindingPerLanguageName (project.ProjectType);
 			return System.IO.Path.GetFileName (langBinding.GetCompiledOutputName (project));
 		}
 	}

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/AbstractProject.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/AbstractProject.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/AbstractProject.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -56,7 +56,7 @@
 		protected ProjectReferenceCollection projectReferences = new ProjectReferenceCollection();
 		
 		protected DeployInformation deployInformation = new DeployInformation();
-		FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
+		FileUtilityService fileUtilityService = Runtime.FileUtilityService;
 		
 		[Browsable(false)]
 		public string BaseDirectory {
@@ -73,11 +73,10 @@
 			}
 			set {
 				if (projectname != value && value != null && value.Length > 0) {
-					IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
-					if (!projectService.ExistsEntryWithName(value)) {
+					if (!Runtime.ProjectService.ExistsEntryWithName(value)) {
 						string oldName = projectname;
 						projectname = value;
-						projectService.OnRenameProject(new ProjectRenameEventArgs(this, oldName, value));
+						Runtime.ProjectService.OnRenameProject(new ProjectRenameEventArgs(this, oldName, value));
 						OnNameChanged(EventArgs.Empty);
 					}
 				}
@@ -190,8 +189,7 @@
 
 		public bool IsCompileable(string fileName)
 		{
-			LanguageBindingService languageBindingService = (LanguageBindingService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(LanguageBindingService));
-			return languageBindingService.GetBindingPerLanguageName(ProjectType).CanCompile(fileName);
+			return Runtime.Languages.GetBindingPerLanguageName (ProjectType).CanCompile(fileName);
 		}
 		
 		public void SearchNewFiles()
@@ -262,12 +260,10 @@
 			}
 			if (version == "1.0") {
 				string tempFile = Path.GetTempFileName();
-				IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-				messageService.ShowMessage(String.Format (GettextCatalog.GetString ("Old project file format found.\n It will be automatically converted to {0} information"), currentProjectFileVersion));
-				PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
+				Runtime.MessageService.ShowMessage(String.Format (GettextCatalog.GetString ("Old project file format found.\n It will be automatically converted to {0} information"), currentProjectFileVersion));
 				
 				ConvertXml.Convert(fileName,
-				                   propertyService.DataDirectory + Path.DirectorySeparatorChar +
+				                   Runtime.Properties.DataDirectory + Path.DirectorySeparatorChar +
 				                   "ConversionStyleSheets" + Path.DirectorySeparatorChar +
 				                   "ConvertPrjx10to11.xsl",
 				                   tempFile);
@@ -278,12 +274,12 @@
 					File.Delete(tempFile);
 					return;
 				} catch (Exception) {
-					messageService.ShowError(GettextCatalog.GetString ("Error writing the old project file.\nCheck if you have write permission on the project file (.prjx).\n A non persistent proxy project will be created but no changes will be saved.\nIt is better if you close MonoDevelop and correct the problem."));
+					Runtime.MessageService.ShowError(GettextCatalog.GetString ("Error writing the old project file.\nCheck if you have write permission on the project file (.prjx).\n A non persistent proxy project will be created but no changes will be saved.\nIt is better if you close MonoDevelop and correct the problem."));
 					if (File.Exists(tempFile)) {
 						doc.Load(tempFile);
 						File.Delete(tempFile);
 					} else {
-						messageService.ShowError("damn! (should never happen)");
+						Runtime.MessageService.ShowError("damn! (should never happen)");
 					}
 				}
 			}
@@ -505,11 +501,10 @@
 			
 			doc.DocumentElement.AppendChild(configurationElement);
 			
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
-			fileUtilityService.ObservedSave(new NamedFileOperationDelegate(doc.Save), 
-			                                fileName, 
-                                                        GettextCatalog.GetString ("Can't save solution\nPlease check your file and directory permissions."), 
-							FileErrorPolicy.ProvideAlternative);
+			Runtime.FileUtilityService.ObservedSave(new NamedFileOperationDelegate(doc.Save), 
+											fileName, 
+											GettextCatalog.GetString ("Can't save solution\nPlease check your file and directory permissions."), 
+											FileErrorPolicy.ProvideAlternative);
 		}
 		
 		public virtual string GetParseableFileContent(string fileName)
@@ -529,8 +524,7 @@
 				if (fdiag.Run() == (int)Gtk.ResponseType.Ok) {
 					string filename = fdiag.Filename;
 					SaveProject(filename);
-					IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-					messageService.ShowMessage(filename, GettextCatalog.GetString ("Project saved"));
+					Runtime.MessageService.ShowMessage(filename, GettextCatalog.GetString ("Project saved"));
 				}
 				
 				fdiag.Hide ();
@@ -545,8 +539,7 @@
 			}
 			foreach (ProjectReference projectReference in ProjectReferences) {
 				if (projectReference.ReferenceType == ReferenceType.Project) {
-					IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
-					ArrayList allProjects = Combine.GetAllProjects (projectService.CurrentOpenCombine);
+					ArrayList allProjects = Combine.GetAllProjects (Runtime.ProjectService.CurrentOpenCombine);
 					foreach (ProjectCombineEntry entry in allProjects)
 					{
 						IProject proj = entry.Project;

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/Deployment/AssemblyDeploy.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/Deployment/AssemblyDeploy.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/Deployment/AssemblyDeploy.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -24,13 +24,12 @@
 		public void DeployProject(IProject project)
 		{
 			if (project.DeployInformation.DeployTarget.Length == 0) {
-				IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-				messageService.ShowError(GettextCatalog.GetString ("Can't deploy: no deployment target set"));
+				Runtime.MessageService.ShowError(GettextCatalog.GetString ("Can't deploy: no deployment target set"));
 				return;
 			}
 			try {
 				AbstractProjectConfiguration config = (AbstractProjectConfiguration)project.ActiveConfiguration;
-				FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
+				FileUtilityService fileUtilityService = Runtime.FileUtilityService;
 				string assembly = fileUtilityService.GetDirectoryNameWithSeparator(config.OutputDirectory) + config.OutputAssembly;
 				
 				foreach (string  ext in extensions) {
@@ -41,8 +40,7 @@
 				}
 				throw new Exception("Assembly not found.");
 			} catch (Exception e) {
-				IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-				messageService.ShowError(e);
+				Runtime.MessageService.ShowError(e);
 			}
 		}
 	}

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/Deployment/FileDeploy.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/Deployment/FileDeploy.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/Deployment/FileDeploy.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -19,13 +19,12 @@
 		public void DeployProject(IProject project)
 		{
 			if (project.DeployInformation.DeployTarget.Length == 0) {
-				IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-				messageService.ShowError(GettextCatalog.GetString ("Can't deploy: you forgot to specify a deployment script"));
+				Runtime.MessageService.ShowError(GettextCatalog.GetString ("Can't deploy: you forgot to specify a deployment script"));
 				return;
 			}
 			
 			try {
-				FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
+				FileUtilityService fileUtilityService = Runtime.FileUtilityService;
 				foreach (ProjectFile fInfo in project.ProjectFiles) {
 					try { 
 						if (!project.DeployInformation.IsFileExcluded(fInfo.Name)) {
@@ -40,8 +39,7 @@
 					}
 				}
 			} catch (Exception e) {
-				IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-				messageService.ShowError(e);
+				Runtime.MessageService.ShowError(e);
 			}
 		}
 	}

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/Deployment/ScriptDeploy.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/Deployment/ScriptDeploy.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/Deployment/ScriptDeploy.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -19,20 +19,18 @@
 		public void DeployProject(IProject project)
 		{
 			if (project.DeployInformation.DeployScript.Length == 0) {
-				IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-				messageService.ShowError(GettextCatalog.GetString ("Can't deploy: you forgot to specify a deployment script"));
+				Runtime.MessageService.ShowError(GettextCatalog.GetString ("Can't deploy: you forgot to specify a deployment script"));
 				return;
 			}
 			try {
-				FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
+				FileUtilityService fileUtilityService = Runtime.FileUtilityService;
 				if (fileUtilityService.TestFileExists(project.DeployInformation.DeployScript)) {
 					ProcessStartInfo pInfo = new ProcessStartInfo(project.DeployInformation.DeployScript);
 					pInfo.WorkingDirectory = Path.GetDirectoryName(project.DeployInformation.DeployScript);
 					Process.Start(pInfo);
 				}
 			} catch (Exception e) {
-				IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-				messageService.ShowError(e, GettextCatalog.GetString ("Error while executing deploy script"));
+				Runtime.MessageService.ShowError(e, GettextCatalog.GetString ("Error while executing deploy script"));
 			}
 		}
 	}

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/IncludeFilesDialog.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/IncludeFilesDialog.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/IncludeFilesDialog.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -38,7 +38,7 @@
 		// regular members
 		StringCollection newFiles;
 		IProject         project;
-		FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
+		FileUtilityService fileUtilityService = Runtime.FileUtilityService;
 		
 		public IncludeFilesDialog(IProject project, StringCollection newFiles)
 		{

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/ProjectReference.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/ProjectReference.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Project/Project/ProjectReference.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -80,8 +80,7 @@
 			}
 			set {
 				localCopy = value;
-				IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
-				projectService.SaveCombine();
+				Runtime.ProjectService.SaveCombine();
 			}
 		}
 		
@@ -98,11 +97,10 @@
 					return reference;
 				
 				case ReferenceType.Gac:
-					string file = ((IParserService)ServiceManager.GetService (typeof (IParserService))).LoadAssemblyFromGac (GetPathToGACAssembly (this));
+					string file = Runtime.ParserService.LoadAssemblyFromGac (GetPathToGACAssembly (this));
 					return file == String.Empty ? reference : file;
 				case ReferenceType.Project:
-					IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
-					string projectOutputLocation   = projectService.GetOutputAssemblyName(reference);
+					string projectOutputLocation   = Runtime.ProjectService.GetOutputAssemblyName(reference);
 					return projectOutputLocation;
 				
 				default:

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/CodeTemplateLoader.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/CodeTemplateLoader.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/CodeTemplateLoader.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -86,8 +86,7 @@
 				doc.DocumentElement.AppendChild(codeTemplateGroup.ToXmlElement(doc));
 			}
 			
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
-			fileUtilityService.ObservedSave(new NamedFileOperationDelegate(doc.Save), fileName, FileErrorPolicy.ProvideAlternative);
+			Runtime.FileUtilityService.ObservedSave(new NamedFileOperationDelegate(doc.Save), fileName, FileErrorPolicy.ProvideAlternative);
 		}
 		
 		/// <summary>
@@ -96,16 +95,12 @@
 		/// </summary>
 		static CodeTemplateLoader()
 		{
-			PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
-			
-			if (!LoadTemplatesFromStream(Path.Combine(propertyService.ConfigDirectory, TemplateFileName))) {
+			if (!LoadTemplatesFromStream(Path.Combine(Runtime.Properties.ConfigDirectory, TemplateFileName))) {
 				Console.WriteLine("Templates: can't load user defaults, reading system defaults");
-				if (!LoadTemplatesFromStream(propertyService.DataDirectory + 
+				if (!LoadTemplatesFromStream(Runtime.Properties.DataDirectory + 
 				                             Path.DirectorySeparatorChar   + "options" +
 				                             Path.DirectorySeparatorChar   + TemplateFileName)) {
-					IMessageService messageService = (IMessageService)ServiceManager.GetService(typeof(IMessageService));
-					messageService.ShowWarning(GettextCatalog.GetString ("Can't load templates configuration file"));
+					Runtime.MessageService.ShowWarning(GettextCatalog.GetString ("Can't load templates configuration file"));
 				}
 			}
 		}
@@ -116,8 +111,7 @@
 		/// </summary>
 		public static void SaveTemplates()
 		{
-			PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-			WriteTemplatesToFile(Path.Combine(propertyService.ConfigDirectory, TemplateFileName));
+			WriteTemplatesToFile (Path.Combine (Runtime.Properties.ConfigDirectory, TemplateFileName));
 		}
 	}
 }

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/FileTemplate.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/FileTemplate.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/FileTemplate.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -154,20 +154,16 @@
 		
 		static FileTemplate()
 		{
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
-			PropertyService    propertyService    = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-			
 			LoadTemplates ((FileTemplateCodon[])(AddInTreeSingleton.AddInTree.GetTreeNode ("/MonoDevelop/FileTemplates").BuildChildItems (new object ()).ToArray (typeof (FileTemplateCodon))));
 		}
 
 		static void LoadTemplates (FileTemplateCodon[] codons)
 		{
-			IMessageService messageService = (IMessageService) ServiceManager.GetService (typeof (IMessageService));
 			foreach (FileTemplateCodon codon in codons) {
 				try {
 					LoadFileTemplate (codon.Location);
 				} catch (Exception e) {
-					messageService.ShowError (e, String.Format (GettextCatalog.GetString ("Error loading template file {0}"), codon.Location));
+					Runtime.MessageService.ShowError (e, String.Format (GettextCatalog.GetString ("Error loading template file {0}"), codon.Location));
 				}
 			}
 		}

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/ProjectTemplates/CombineDescriptor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/ProjectTemplates/CombineDescriptor.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/ProjectTemplates/CombineDescriptor.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -56,11 +56,8 @@
 		
 		public string CreateCombine(ProjectCreateInformation projectCreateInformation, string defaultLanguage)
 		{
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
-			StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
-			
 			Combine newCombine     = new Combine();
-			string  newCombineName = stringParserService.Parse(name, new string[,] { 
+			string  newCombineName = Runtime.StringParserService.Parse(name, new string[,] { 
 				{"ProjectName", projectCreateInformation.ProjectName}
 			});
 			
@@ -93,7 +90,7 @@
 			projectCreateInformation.ProjectBasePath = oldProjectPath;
 			
 			// Save combine
-			string combineLocation = fileUtilityService.GetDirectoryNameWithSeparator(projectCreateInformation.CombinePath) + newCombineName + ".cmbx";
+			string combineLocation = Runtime.FileUtilityService.GetDirectoryNameWithSeparator(projectCreateInformation.CombinePath) + newCombineName + ".cmbx";
 			newCombine.OutputDirectory = Path.Combine (Path.Combine (Path.GetDirectoryName (combineLocation), "build"), "bin");
 			if (File.Exists(combineLocation)) {
 				IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/ProjectTemplates/ProjectDescriptor.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/ProjectTemplates/ProjectDescriptor.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/ProjectTemplates/ProjectDescriptor.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -74,17 +74,15 @@
 		
 		public string CreateProject(ProjectCreateInformation projectCreateInformation, string defaultLanguage)
 		{
-			LanguageBindingService languageBindingService = (LanguageBindingService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(LanguageBindingService));
-			StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
+			StringParserService stringParserService = Runtime.StringParserService;
+			FileUtilityService fileUtilityService = Runtime.FileUtilityService;
 			
 			string language = languageName != null && languageName.Length > 0 ? languageName : defaultLanguage;
 			
-			ILanguageBinding languageinfo = languageBindingService.GetBindingPerLanguageName(language);
+			ILanguageBinding languageinfo = Runtime.Languages.GetBindingPerLanguageName(language);
 			
 			if (languageinfo == null) {
-				IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-				messageService.ShowError(String.Format (GettextCatalog.GetString ("Can't create project with type : {0}"), language));
+				Runtime.MessageService.ShowError(String.Format (GettextCatalog.GetString ("Can't create project with type : {0}"), language));
 				return String.Empty;
 			}
 			
@@ -109,8 +107,7 @@
 				project.ProjectFiles.Add(resource);
 				
 				if (File.Exists(fileName)) {
-					IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-					if (!messageService.AskQuestion(String.Format (GettextCatalog.GetString ("File {0} already exists, do you want to overwrite\nthe existing file ?"), fileName), GettextCatalog.GetString ("File already exists"))) {
+					if (!Runtime.MessageService.AskQuestion(String.Format (GettextCatalog.GetString ("File {0} already exists, do you want to overwrite\nthe existing file ?"), fileName), GettextCatalog.GetString ("File already exists"))) {
 						continue;
 					}
 				}
@@ -123,8 +120,7 @@
 					sr.Write(stringParserService.Parse(file.Content, new string[,] { {"ProjectName", projectCreateInformation.ProjectName}, {"FileName", fileName}}));
 					sr.Close();
 				} catch (Exception ex) {
-					IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-					messageService.ShowError(ex, String.Format (GettextCatalog.GetString ("File {0} could not be written."), fileName));
+					Runtime.MessageService.ShowError(ex, String.Format (GettextCatalog.GetString ("File {0} could not be written."), fileName));
 				}
 			}
 	
@@ -135,8 +131,7 @@
 				project.ProjectFiles.Add(new ProjectFile(fileName));
 				
 				if (File.Exists(fileName)) {
-					IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-					if (!messageService.AskQuestion(String.Format (GettextCatalog.GetString ("File {0} already exists, do you want to overwrite\nthe existing file ?"), fileName), GettextCatalog.GetString ("File already exists"))) {
+					if (!Runtime.MessageService.AskQuestion(String.Format (GettextCatalog.GetString ("File {0} already exists, do you want to overwrite\nthe existing file ?"), fileName), GettextCatalog.GetString ("File already exists"))) {
 						continue;
 					}
 				}
@@ -149,8 +144,7 @@
 					sr.Write(stringParserService.Parse(file.Content, new string[,] { {"ProjectName", projectCreateInformation.ProjectName}, {"FileName", fileName}}));
 					sr.Close();
 				} catch (Exception ex) {
-					IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-					messageService.ShowError(ex, String.Format (GettextCatalog.GetString ("File {0} could not be written."), fileName));
+					Runtime.MessageService.ShowError(ex, String.Format (GettextCatalog.GetString ("File {0} could not be written."), fileName));
 				}
 			}
 			
@@ -158,8 +152,7 @@
 			string projectLocation = fileUtilityService.GetDirectoryNameWithSeparator(projectCreateInformation.ProjectBasePath) + newProjectName + ".prjx";
 			
 			if (File.Exists(projectLocation)) {
-				IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-				if (messageService.AskQuestion(String.Format (GettextCatalog.GetString ("Project file {0} already exists, do you want to overwrite\nthe existing file ?"), projectLocation),  GettextCatalog.GetString ("File already exists"))) {
+				if (Runtime.MessageService.AskQuestion(String.Format (GettextCatalog.GetString ("Project file {0} already exists, do you want to overwrite\nthe existing file ?"), projectLocation),  GettextCatalog.GetString ("File already exists"))) {
 					project.SaveProject(projectLocation);
 				}
 			} else {

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/ProjectTemplates/ProjectTemplate.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/ProjectTemplates/ProjectTemplate.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/ProjectTemplates/ProjectTemplate.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -35,8 +35,7 @@
 		
 		public void Run(ProjectCreateInformation projectCreateInformation)
 		{
-			IFileService fileService = (IFileService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IFileService));
-			fileService.OpenFile(projectCreateInformation.ProjectBasePath + Path.DirectorySeparatorChar + fileName);
+			Runtime.FileService.OpenFile (projectCreateInformation.ProjectBasePath + Path.DirectorySeparatorChar + fileName);
 		}
 	}
 	
@@ -193,8 +192,7 @@
 		
 		public void OpenCreatedCombine()
 		{
-			IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
-			projectService.OpenCombine(lastCombine);
+			Runtime.ProjectService.OpenCombine(lastCombine);
 			
 			foreach (OpenFileAction action in actions) {
 				action.Run(projectCreateInformation);
@@ -212,19 +210,16 @@
 		
 		static ProjectTemplate()
 		{
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
-			PropertyService    propertyService    = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
 			LoadTemplates ((ProjectTemplateCodon[])(AddInTreeSingleton.AddInTree.GetTreeNode ("/MonoDevelop/ProjectTemplates").BuildChildItems (new object ()).ToArray (typeof (ProjectTemplateCodon))));
 		}
 
 		static void LoadTemplates (ProjectTemplateCodon[] codons)
-                {
-			IMessageService messageService = (IMessageService) ServiceManager.GetService (typeof (IMessageService));
+		{
 			foreach (ProjectTemplateCodon codon in codons) {
 				try {
 					ProjectTemplates.Add (new ProjectTemplate (codon.Location));
 				} catch (Exception e) {
-					messageService.ShowError (e, String.Format (GettextCatalog.GetString ("Error loading template file {0}"), codon.Location));
+					Runtime.MessageService.ShowError (e, String.Format (GettextCatalog.GetString ("Error loading template file {0}"), codon.Location));
 				}
 			}
 		}

Modified: trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/TextTemplate.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/TextTemplate.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Internal/Templates/TextTemplate.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -12,7 +12,7 @@
 using System.Collections.Specialized;
 using System.Diagnostics;
 
-using MonoDevelop.Core.Services;
+using MonoDevelop.Services;
 
 namespace MonoDevelop.Internal.Templates
 {
@@ -81,10 +81,7 @@
 		
 		static TextTemplate()
 		{
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
-			PropertyService    propertyService    = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-			
-			StringCollection files = fileUtilityService.SearchDirectory(propertyService.DataDirectory + 
+			StringCollection files = Runtime.FileUtilityService.SearchDirectory (Runtime.Properties.DataDirectory + 
 			                            Path.DirectorySeparatorChar + "options" + 
 			                            Path.DirectorySeparatorChar + "textlib", "*.xml");
 			foreach (string file in files) {

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/AmbienceService/AmbienceService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/AmbienceService/AmbienceService.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/AmbienceService/AmbienceService.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -20,8 +20,7 @@
 		
 		public IProperties CodeGenerationProperties {
 			get {
-				PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-				return (IProperties)propertyService.GetProperty(codeGenerationProperty, new DefaultProperties());
+				return (IProperties) Runtime.Properties.GetProperty (codeGenerationProperty, new DefaultProperties());
 			}
 		}
 		
@@ -45,8 +44,7 @@
 		
 		public AmbienceReflectionDecorator CurrentAmbience {
 			get {
-				PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-				string language = propertyService.GetProperty(ambienceProperty, "CSharp");
+				string language = Runtime.Properties.GetProperty(ambienceProperty, "CSharp");
 				return new AmbienceReflectionDecorator((IAmbience)AddInTreeSingleton.AddInTree.GetTreeNode("/SharpDevelop/Workbench/Ambiences").BuildChildItem(language, this));
 			}
 		}
@@ -60,8 +58,7 @@
 		
 		public override void InitializeService()
 		{
-			PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-			propertyService.PropertyChanged += new PropertyEventHandler(PropertyChanged);
+			Runtime.Properties.PropertyChanged += new PropertyEventHandler(PropertyChanged);
 		}
 		
 		

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/AmbienceService/CodeDOMGeneratorUtility.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/AmbienceService/CodeDOMGeneratorUtility.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/AmbienceService/CodeDOMGeneratorUtility.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -18,7 +18,7 @@
 {
 	public class CodeDOMGeneratorUtility 
 	{
-		AmbienceService     ambienceService = (AmbienceService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(AmbienceService));
+		AmbienceService ambienceService = Runtime.Ambience;
 		
 		public CodeGeneratorOptions CreateCodeGeneratorOptions {
 			get {
@@ -27,8 +27,7 @@
 				options.BracingStyle             = ambienceService.CodeGenerationProperties.GetProperty("StartBlockOnSameLine", true) ? "Block" : "C";
 				options.ElseOnClosing            = ambienceService.CodeGenerationProperties.GetProperty("ElseOnClosing", true);
 				
-				PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-				IProperties docProperties = ((IProperties)propertyService.GetProperty("MonoDevelop.TextEditor.Document.Document.DefaultDocumentAggregatorProperties", new DefaultProperties()));
+				IProperties docProperties = ((IProperties)Runtime.Properties.GetProperty("MonoDevelop.TextEditor.Document.Document.DefaultDocumentAggregatorProperties", new DefaultProperties()));
 				
 				if ((bool)docProperties.GetProperty("TabsToSpaces", false)) {
 					StringBuilder indentationString = new StringBuilder();

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/MenuService/MenuService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/MenuService/MenuService.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/MenuService/MenuService.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -112,8 +112,6 @@
 		//public void CreateQuickInsertMenu(TextBoxBase targetControl, Control popupControl, string[,] quickInsertMenuItems)		
 		public void CreateQuickInsertMenu(Gtk.Editable targetControl, Gtk.Button popupControl, string[,] quickInsertMenuItems)
 		{
-			StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
-			
 			//CommandBarContextMenu contextMenu = new CommandBarContextMenu();
 			Gtk.Menu contextMenu = new Gtk.Menu();
 			for (int i = 0; i < quickInsertMenuItems.GetLength(0); ++i) {
@@ -121,7 +119,7 @@
 					contextMenu.Append(new SdMenuSeparator());
 				} else {
 					SdMenuCommand cmd = new SdMenuCommand(this,
-					                                      stringParserService.Parse(quickInsertMenuItems[i, 0]),
+					                                      Runtime.StringParserService.Parse (quickInsertMenuItems[i, 0]),
 					                                      new QuickInsertMenuHandler(targetControl, quickInsertMenuItems[i, 1]).EventHandler);
 					contextMenu.Append(cmd);
 				}

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/MessageService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/MessageService.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/MessageService.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -20,7 +20,7 @@
 	/// </summary>
 	public class MessageService : AbstractService, IMessageService
 	{
-		StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
+		StringParserService stringParserService = Runtime.StringParserService;
 		
 		public void ShowError(Exception ex)
 		{

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/ParserService/DefaultParserService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/ParserService/DefaultParserService.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/ParserService/DefaultParserService.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -229,18 +229,17 @@
 		
 		void SetDefaultCompletionFileLocation()
 		{
-			PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-			FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService (typeof (FileUtilityService));
+			PropertyService propertyService = Runtime.Properties;
 			string path = propertyService.GetProperty("SharpDevelop.CodeCompletion.DataDirectory", String.Empty).ToString();
 			if (path == String.Empty) {
-                        	path = Path.Combine (fileUtilityService.GetDirectoryNameWithSeparator(propertyService.ConfigDirectory), "CodeCompletionData");
+				path = Path.Combine (Runtime.FileUtilityService.GetDirectoryNameWithSeparator(propertyService.ConfigDirectory), "CodeCompletionData");
 				propertyService.SetProperty ("SharpDevelop.CodeCompletion.DataDirectory", path);
 				propertyService.SaveProperties ();
 			}
-                        if (!Directory.Exists (path))
-                                Directory.CreateDirectory (path);
+			if (!Directory.Exists (path))
+				Directory.CreateDirectory (path);
 
-			codeCompletionPath = fileUtilityService.GetDirectoryNameWithSeparator(path);
+			codeCompletionPath = Runtime.FileUtilityService.GetDirectoryNameWithSeparator(path);
 		}
 
 		public override void InitializeService()
@@ -255,7 +254,7 @@
 			coreDatabase = new AssemblyCodeCompletionDatabase (codeCompletionPath, coreName, this);
 			databases [CoreDB] = coreDatabase;
 			
-			IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
+			IProjectService projectService = Runtime.ProjectService;
 			projectService.CombineOpened += new CombineEventHandler(OnCombineOpened);
 			projectService.CombineClosed += new CombineEventHandler(OnCombineClosed);
 			projectService.FileRemovedFromProject += new ProjectFileEventHandler (OnProjectFilesChanged);
@@ -1048,9 +1047,8 @@
 			ICompilationUnitBase parserOutput = null;
 			
 			if (fileContent == null) {
-				IProjectService projectService = (IProjectService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IProjectService));
-				if (projectService.CurrentOpenCombine != null) {
-					ArrayList projects = Combine.GetAllProjects(projectService.CurrentOpenCombine);
+				if (Runtime.ProjectService.CurrentOpenCombine != null) {
+					ArrayList projects = Combine.GetAllProjects (Runtime.ProjectService.CurrentOpenCombine);
 					foreach (ProjectCombineEntry entry in projects) {
 						if (entry.Project.IsFileInProject(fileName)) {
 							fileContent = entry.Project.GetParseableFileContent(fileName);

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/Project/DefaultProjectService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/Project/DefaultProjectService.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/Project/DefaultProjectService.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -120,7 +120,7 @@
 			}
 		}
 		
-		FileUtilityService fileUtilityService = (FileUtilityService)ServiceManager.GetService(typeof(FileUtilityService));
+		FileUtilityService fileUtilityService = Runtime.FileUtilityService;
 		
 		public void OpenCombine(string filename)
 		{
@@ -135,8 +135,7 @@
 			if (!fileUtilityService.TestFileExists(filename)) {
 				return;
 			}
-			IStatusBarService statusBarService = (IStatusBarService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IStatusBarService));
-			statusBarService.SetMessage(GettextCatalog.GetString ("Opening Combine..."));
+			Runtime.Gui.StatusBar.SetMessage(GettextCatalog.GetString ("Opening Combine..."));
 				
 			if (Path.GetExtension(filename).ToUpper() == ".PRJX") {
 				string validcombine = Path.ChangeExtension(filename, ".cmbx");
@@ -155,13 +154,12 @@
 			} else {
 				LoadCombine(filename);
 			}
-			statusBarService.SetMessage(GettextCatalog.GetString ("Ready"));
+			Runtime.Gui.StatusBar.SetMessage(GettextCatalog.GetString ("Ready"));
 		}
 		
 		void LoadCombine(string filename)
 		{
-			DispatchService dispatcher = (DispatchService)ServiceManager.GetService (typeof (DispatchService));
-			dispatcher.BackgroundDispatch (new StatefulMessageHandler (backgroundLoadCombine), filename);
+			Runtime.DispatchService.BackgroundDispatch (new StatefulMessageHandler (backgroundLoadCombine), filename);
 		}
 
 		void backgroundLoadCombine (object arg)
@@ -176,8 +174,7 @@
 			openCombine         = loadingCombine;
 			openCombineFileName = filename;
 			
-			IFileService fileService = (IFileService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IFileService));
-			fileService.RecentOpen.AddLastProject (filename, openCombine.Name);
+			Runtime.FileService.RecentOpen.AddLastProject (filename, openCombine.Name);
 			
 			OnCombineOpened(new CombineEventArgs(openCombine));
 			openCombine.FileAddedToProject += new ProjectFileEventHandler (NotifyFileAddedToProject);
@@ -257,8 +254,7 @@
 		{
 			if (openCombine != null) {
 				DoBeforeCompileAction();
-				TaskService taskService = (TaskService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(TaskService));
-				taskService.ClearTasks();
+				Runtime.TaskService.ClearTasks();
 				
 				openCombine.Build(false);
 			}
@@ -268,8 +264,7 @@
 		{
 			if (openCombine != null) {
 				DoBeforeCompileAction();
-				TaskService taskService = (TaskService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(TaskService));
-				taskService.ClearTasks();
+				Runtime.TaskService.ClearTasks();
 				
 				openCombine.Build(true);
 			}
@@ -278,15 +273,12 @@
 		ILanguageBinding BeforeCompile(IProject project)
 		{
 			DoBeforeCompileAction();
-			TaskService taskService = (TaskService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(TaskService));
-			StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
 			
-			taskService.NotifyTaskChange();
+			Runtime.TaskService.NotifyTaskChange();
 			
 			// cut&pasted from CombineEntry.cs
-			stringParserService.Properties["Project"] = project.Name;
-			IStatusBarService statusBarService = (IStatusBarService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IStatusBarService));
-			statusBarService.SetMessage(String.Format (GettextCatalog.GetString ("Compiling {0}"), project.Name));
+			Runtime.StringParserService.Properties["Project"] = project.Name;
+			Runtime.Gui.StatusBar.SetMessage(String.Format (GettextCatalog.GetString ("Compiling {0}"), project.Name));
 			
 			string outputDir = ((AbstractProjectConfiguration)project.ActiveConfiguration).OutputDirectory;
 			try {
@@ -298,26 +290,24 @@
 				throw new ApplicationException("Can't create project output directory " + outputDir + " original exception:\n" + e.ToString());
 			}
 			// cut&paste EDND
-			LanguageBindingService languageBindingService = (LanguageBindingService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(LanguageBindingService));
-			return languageBindingService.GetBindingPerLanguageName(project.ProjectType);
+			return Runtime.Languages.GetBindingPerLanguageName(project.ProjectType);
 		}
 		
 		void AfterCompile(IProject project, ICompilerResult res)
 		{
 			// cut&pasted from CombineEntry.cs
-			TaskService taskService = (TaskService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(TaskService));
 			foreach (CompilerError err in res.CompilerResults.Errors) {
-				taskService.AddTask(new Task(project, err));
+				Runtime.TaskService.AddTask(new Task(project, err));
 			}
 			
-			if (taskService.Errors > 0) {
+			if (Runtime.TaskService.Errors > 0) {
 				++CombineEntry.BuildErrors;
 			} else {
 				++CombineEntry.BuildProjects;
 			}
 			
-			taskService.CompilerOutput = res.CompilerOutput;
-			taskService.NotifyTaskChange();
+			Runtime.TaskService.CompilerOutput = res.CompilerOutput;
+			Runtime.TaskService.NotifyTaskChange();
 		}
 		
 		public void RecompileProject(IProject project)
@@ -332,8 +322,7 @@
 		
 		void DoBeforeCompileAction()
 		{
-			PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-			BeforeCompileAction action = (BeforeCompileAction)propertyService.GetProperty("SharpDevelop.Services.DefaultParserService.BeforeCompileAction", BeforeCompileAction.SaveAllFiles);
+			BeforeCompileAction action = (BeforeCompileAction)Runtime.Properties.GetProperty("SharpDevelop.Services.DefaultParserService.BeforeCompileAction", BeforeCompileAction.SaveAllFiles);
 			
 			switch (action) {
 				case BeforeCompileAction.Nothing:
@@ -343,8 +332,7 @@
 					foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection) {
 						if (content.ContentName != null && content.IsDirty) {
 							if (!save) {
-								IMessageService messageService =(IMessageService)ServiceManager.GetService(typeof(IMessageService));
-								if (messageService.AskQuestion(GettextCatalog.GetString ("Save changed files?"))) {
+								if (Runtime.MessageService.AskQuestion(GettextCatalog.GetString ("Save changed files?"))) {
 									save = true;
 								} else {
 									break;
@@ -471,10 +459,8 @@
 		public override void InitializeService()
 		{
 			base.InitializeService();
-			IFileService fileService = (IFileService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IFileService));
-			
-			fileService.FileRemoved += new FileEventHandler(CheckFileRemove);
-			fileService.FileRenamed += new FileEventHandler(CheckFileRename);
+			Runtime.FileService.FileRemoved += new FileEventHandler(CheckFileRemove);
+			Runtime.FileService.FileRenamed += new FileEventHandler(CheckFileRename);
 		}
 		
 		string MakeValidName(string str)
@@ -488,9 +474,7 @@
 		
 		void RestoreCombinePreferences(Combine combine, string combinefilename)
 		{
-			DispatchService dispatcher = (DispatchService)ServiceManager.GetService (typeof (DispatchService));
-			PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-			string directory = propertyService.ConfigDirectory + "CombinePreferences";
+			string directory = Runtime.Properties.ConfigDirectory + "CombinePreferences";
 			if (!Directory.Exists(directory)) {
 				return;
 			}
@@ -507,11 +491,10 @@
 				XmlElement root = doc.DocumentElement;
 				string combinepath = Path.GetDirectoryName(combinefilename);
 				if (root["Files"] != null) {
-					IFileService fileService = (IFileService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IFileService));
 					foreach (XmlElement el in root["Files"].ChildNodes) {
 						string fileName = fileUtilityService.RelativeToAbsolutePath(combinepath, el.Attributes["filename"].InnerText);
 						if (File.Exists(fileName)) {
-							fileService.OpenFile (fileName);
+							Runtime.FileService.OpenFile (fileName);
 						}
 					}
 				}
@@ -533,7 +516,7 @@
 					foreach (IViewContent content in WorkbenchSingleton.Workbench.ViewContentCollection) {
 						if (content.ContentName != null &&
 							content.ContentName == name) {
-							dispatcher.GuiDispatch (new MessageHandler (content.WorkbenchWindow.SelectWindow));
+							Runtime.DispatchService.GuiDispatch (new MessageHandler (content.WorkbenchWindow.SelectWindow));
 							break;
 						}
 					}
@@ -543,8 +526,7 @@
 		
 		void SaveCombinePreferences(Combine combine, string combinefilename)
 		{
-			PropertyService propertyService = (PropertyService)ServiceManager.GetService(typeof(PropertyService));
-			string directory = propertyService.ConfigDirectory + "CombinePreferences";
+			string directory = Runtime.Properties.ConfigDirectory + "CombinePreferences";
 			if (!Directory.Exists(directory)) {
 				Directory.CreateDirectory(directory);
 			}
@@ -603,10 +585,9 @@
 		//********* own events
 		protected virtual void OnCombineOpened(CombineEventArgs e)
 		{
-			DispatchService dispatcher = (DispatchService)ServiceManager.GetService (typeof (DispatchService));
 			GenerateMakefiles ();
 			if (CombineOpened != null) {
-				dispatcher.GuiDispatch (new StatefulMessageHandler (dispatchOpened), e);
+				Runtime.DispatchService.GuiDispatch (new StatefulMessageHandler (dispatchOpened), e);
 				//CombineOpened(this, e);
 			}
 		}
@@ -633,8 +614,7 @@
 		protected virtual void OnCurrentProjectChanged(ProjectEventArgs e)
 		{
 			if (CurrentSelectedProject != null) {
-				StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
-				stringParserService.Properties["PROJECTNAME"] = CurrentSelectedProject.Name;
+				Runtime.StringParserService.Properties["PROJECTNAME"] = CurrentSelectedProject.Name;
 			}
 			if (CurrentProjectChanged != null) {
 				CurrentProjectChanged(this, e);
@@ -662,8 +642,7 @@
 		
 		public string GetOutputAssemblyName(IProject project)
 		{
-			LanguageBindingService languageBindingService = (LanguageBindingService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(LanguageBindingService));
-			ILanguageBinding binding = languageBindingService.GetBindingPerLanguageName(project.ProjectType);
+			ILanguageBinding binding = Runtime.Languages.GetBindingPerLanguageName(project.ProjectType);
 			return binding.GetCompiledOutputName(project);
 		}
 		

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/StatusBar/DefaultStatusBarService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/StatusBar/DefaultStatusBarService.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/StatusBar/DefaultStatusBarService.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -18,7 +18,7 @@
 	public class DefaultStatusBarService : AbstractService, IStatusBarService
 	{
 		SdStatusBar statusBar = null;
-		StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
+		StringParserService stringParserService = Runtime.StringParserService;
 		
 		public DefaultStatusBarService()
 		{
@@ -64,7 +64,6 @@
 		
 		public void SetInsertMode (bool insertMode)
 		{
-			StringParserService stringParserService = (StringParserService)ServiceManager.GetService(typeof(StringParserService));
 			statusBar.ModeStatusBarPanel.Push (1, insertMode ? GettextCatalog.GetString ("INS") : GettextCatalog.GetString ("OVR"));
 		}
 		

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/Tasks/Task.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/Tasks/Task.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/Tasks/Task.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -106,8 +106,7 @@
 		public void JumpToPosition()
 		{
 			if (fileName != null && fileName.Length > 0) {
-				IFileService fileService = (IFileService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IFileService));
-				fileService.OpenFile(fileName,new FileOpeningFinished(OnFileOpened));
+				Runtime.FileService.OpenFile(fileName,new FileOpeningFinished(OnFileOpened));
 			}
 			
 //			CompilerResultListItem li = (CompilerResultListItem)OpenTaskView.FocusedItem;
@@ -129,8 +128,7 @@
 		
 		private void OnFileOpened()
 		{
-			IFileService fileService = (IFileService)MonoDevelop.Core.Services.ServiceManager.GetService(typeof(IFileService));
-			IWorkbenchWindow window = fileService.GetOpenFile(fileName);
+			IWorkbenchWindow window = Runtime.FileService.GetOpenFile(fileName);
 			if (window == null) {
 				return;
 			}

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/Tasks/TaskService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/Tasks/TaskService.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/Tasks/TaskService.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -113,9 +113,8 @@
 		public override void InitializeService()
 		{
 			base.InitializeService();
-			IFileService fileService = (IFileService)ServiceManager.GetService(typeof(IFileService));
-			fileService.FileRenamed += new FileEventHandler(CheckFileRename);
-			fileService.FileRemoved += new FileEventHandler(CheckFileRemove);
+			Runtime.FileService.FileRenamed += new FileEventHandler(CheckFileRename);
+			Runtime.FileService.FileRemoved += new FileEventHandler(CheckFileRemove);
 		}
 		
 		void CheckFileRemove(object sender, FileEventArgs e)

Modified: trunk/MonoDevelop/Core/src/Main/Base/Services/Toolbar/ToolbarService.cs
===================================================================
--- trunk/MonoDevelop/Core/src/Main/Base/Services/Toolbar/ToolbarService.cs	2004-12-06 15:45:40 UTC (rev 2055)
+++ trunk/MonoDevelop/Core/src/Main/Base/Services/Toolbar/ToolbarService.cs	2004-12-06 17:00:46 UTC (rev 2056)
@@ -51,7 +51,6 @@
 			Gtk.Toolbar bar = new Gtk.Toolbar();
 			bar.ToolbarStyle = Gtk.ToolbarStyle.Icons;
 			
-			ResourceService resourceService = (ResourceService)ServiceManager.GetService(typeof(ResourceService));
 			foreach (ToolbarItemCodon childCodon in codon.SubItems) {
 				SdToolbarCommand item = null;
 				
@@ -61,7 +60,7 @@
 						continue;
 					} else {
 						item = new SdToolbarCommand(childCodon.Conditions, owner, GettextCatalog.GetString (childCodon.ToolTip));
-						Gtk.Image img = resourceService.GetImage(childCodon.Icon, Gtk.IconSize.LargeToolbar);
+						Gtk.Image img = Runtime.Gui.Resources.GetImage(childCodon.Icon, Gtk.IconSize.LargeToolbar);
 						item.Add (img);
 						item.Relief = ReliefStyle.None;
 						




More information about the Monodevelop-patches-list mailing list