public static void Init() { SharpSnippetCompilerManager manager = new SharpSnippetCompilerManager(); Assembly exe = manager.GetType().Assembly; string rootPath = Path.GetDirectoryName(exe.Location); string configDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SharpSnippetCompiler"); string dataDirectory = Path.Combine(rootPath, "data"); CoreStartup startup = new CoreStartup("SharpSnippetCompiler"); startup.ConfigDirectory = configDirectory; startup.DataDirectory = dataDirectory; startup.PropertiesName = "SharpSnippetCompiler"; startup.StartCoreServices(); ResourceService.RegisterNeutralStrings(new ResourceManager("Resources.StringResources", exe)); ResourceService.RegisterNeutralImages(new ResourceManager("Resources.BitmapResources", exe)); StringParser.RegisterStringTagProvider(new SharpDevelopStringTagProvider()); string addInFolder = Path.Combine(rootPath, "AddIns"); startup.AddAddInsFromDirectory(addInFolder); startup.RunInitialization(); }
public static void Init() { var manager = new SharpSnippetCompilerManager(); Assembly exe = manager.GetType().Assembly; string rootPath = Path.GetDirectoryName(exe.Location); string configDirectory = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "SharpSnippetCompiler"); string dataDirectory = Path.Combine(rootPath, "data"); var container = new SharpDevelopServiceContainer(ServiceSingleton.FallbackServiceProvider); ServiceSingleton.ServiceProvider = container; var startup = new CoreStartup("SharpSnippetCompiler"); startup.ConfigDirectory = configDirectory; startup.DataDirectory = dataDirectory; startup.PropertiesName = "SharpSnippetCompiler"; FileUtility.ApplicationRootPath = "SharpSnippetCompiler"; startup.StartCoreServices(); SD.ResourceService.RegisterNeutralStrings(new ResourceManager("ICSharpCode.SharpSnippetCompiler.Core.Resources.StringResources", exe)); SD.ResourceService.RegisterNeutralImages(new ResourceManager("ICSharpCode.SharpSnippetCompiler.Core.Resources.BitmapResources", exe)); CommandWrapper.LinkCommandCreator = (link => new LinkCommand(link)); CommandWrapper.RegisterConditionRequerySuggestedHandler = (eh => CommandManager.RequerySuggested += eh); CommandWrapper.UnregisterConditionRequerySuggestedHandler = (eh => CommandManager.RequerySuggested -= eh); StringParser.RegisterStringTagProvider(new SharpDevelopStringTagProvider()); string addInFolder = Path.Combine(rootPath, "AddIns"); startup.AddAddInsFromDirectory(addInFolder); startup.RunInitialization(); }