public static void Initialize (bool updateAddinRegistry) { if (initialized) return; Counters.RuntimeInitialization.BeginTiming (); SetupInstrumentation (); // Set a default sync context if (SynchronizationContext.Current == null) SynchronizationContext.SetSynchronizationContext (new SynchronizationContext ()); AddinManager.AddinLoadError += OnLoadError; AddinManager.AddinLoaded += OnLoad; AddinManager.AddinUnloaded += OnUnload; try { Counters.RuntimeInitialization.Trace ("Initializing Addin Manager"); AddinManager.Initialize (MonoDevelop.Core.PropertyService.ConfigPath); AddinManager.InitializeDefaultLocalizer (new DefaultAddinLocalizer ()); if (updateAddinRegistry) AddinManager.Registry.Update (null); setupService = new SetupService (AddinManager.Registry); Counters.RuntimeInitialization.Trace ("Initialized Addin Manager"); RegisterAddinRepositories (); Counters.RuntimeInitialization.Trace ("Initializing Assembly Service"); systemAssemblyService = new SystemAssemblyService (); systemAssemblyService.Initialize (); initialized = true; } catch (Exception ex) { Console.WriteLine (ex); AddinManager.AddinLoadError -= OnLoadError; AddinManager.AddinLoaded -= OnLoad; AddinManager.AddinUnloaded -= OnUnload; } finally { Counters.RuntimeInitialization.EndTiming (); } }
public static void Initialize (bool updateAddinRegistry) { if (initialized) return; Counters.RuntimeInitialization.BeginTiming (); SetupInstrumentation (); AddinManager.AddinLoadError += OnLoadError; AddinManager.AddinLoaded += OnLoad; AddinManager.AddinUnloaded += OnUnload; try { Counters.RuntimeInitialization.Trace ("Initializing Addin Manager"); AddinManager.Initialize (MonoDevelop.Core.PropertyService.ConfigPath); AddinManager.InitializeDefaultLocalizer (new DefaultAddinLocalizer ()); if (updateAddinRegistry) AddinManager.Registry.Update (null); setupService = new SetupService (AddinManager.Registry); Counters.RuntimeInitialization.Trace ("Initialized Addin Manager"); string prefix = string.Empty; if (PropertyService.IsWindows) prefix = "win-"; string mainRep = "http://monodevelop.com/files/addins/" + prefix + AddinManager.CurrentAddin.Version + "/main.mrep"; AddinRepository[] repos = setupService.Repositories.GetRepositories (); foreach (AddinRepository rep in repos) { if (rep.Url.StartsWith ("http://go-mono.com/md/") || (rep.Url.StartsWith ("http://monodevelop.com/files/addins/") && rep.Url != mainRep)) setupService.Repositories.RemoveRepository (rep.Url); } setupService.Repositories.RegisterRepository (null, mainRep, false); Counters.RuntimeInitialization.Trace ("Initializing Assembly Service"); systemAssemblyService = new SystemAssemblyService (); systemAssemblyService.Initialize (); initialized = true; } catch (Exception ex) { Console.WriteLine (ex); AddinManager.AddinLoadError -= OnLoadError; AddinManager.AddinLoaded -= OnLoad; AddinManager.AddinUnloaded -= OnUnload; } finally { Counters.RuntimeInitialization.EndTiming (); } }
public static void Initialize (bool updateAddinRegistry) { if (initialized) return; Counters.RuntimeInitialization.BeginTiming (); SetupInstrumentation (); if (Platform.IsMac) InitMacFoundation (); // Set a default sync context if (SynchronizationContext.Current == null) SynchronizationContext.SetSynchronizationContext (new SynchronizationContext ()); AddinManager.AddinLoadError += OnLoadError; AddinManager.AddinLoaded += OnLoad; AddinManager.AddinUnloaded += OnUnload; //provides a development-time way to load addins that are being developed in a asperate solution var devAddinDir = Environment.GetEnvironmentVariable ("MONODEVELOP_DEV_ADDINS"); if (devAddinDir != null && devAddinDir.Length == 0) devAddinDir = null; try { Counters.RuntimeInitialization.Trace ("Initializing Addin Manager"); AddinManager.Initialize ( UserProfile.Current.ConfigDir, devAddinDir ?? UserProfile.Current.LocalInstallDir.Combine ("Addins"), devAddinDir ?? UserProfile.Current.CacheDir); AddinManager.InitializeDefaultLocalizer (new DefaultAddinLocalizer ()); if (updateAddinRegistry) AddinManager.Registry.Update (null); setupService = new AddinSetupService (AddinManager.Registry); Counters.RuntimeInitialization.Trace ("Initialized Addin Manager"); PropertyService.Initialize (); //have to do this after the addin service and property service have initialized if (UserDataMigrationService.HasSource) { Counters.RuntimeInitialization.Trace ("Migrating User Data from MD " + UserDataMigrationService.SourceVersion); UserDataMigrationService.StartMigration (); } RegisterAddinRepositories (); Counters.RuntimeInitialization.Trace ("Initializing Assembly Service"); systemAssemblyService = new SystemAssemblyService (); systemAssemblyService.Initialize (); initialized = true; } catch (Exception ex) { Console.WriteLine (ex); AddinManager.AddinLoadError -= OnLoadError; AddinManager.AddinLoaded -= OnLoad; AddinManager.AddinUnloaded -= OnUnload; } finally { Counters.RuntimeInitialization.EndTiming (); } }
public static void Initialize (bool updateAddinRegistry) { if (initialized) return; Counters.RuntimeInitialization.BeginTiming (); SetupInstrumentation (); Platform.Initialize (); // Set a default sync context if (SynchronizationContext.Current == null) SynchronizationContext.SetSynchronizationContext (new SynchronizationContext ()); // Hook up the SSL certificate validation codepath System.Net.ServicePointManager.ServerCertificateValidationCallback += delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { if (sslPolicyErrors == SslPolicyErrors.None) return true; if (sender is WebRequest) sender = ((WebRequest)sender).RequestUri.Host; return WebCertificateService.GetIsCertificateTrusted (sender as string, certificate.GetPublicKeyString ()); }; AddinManager.AddinLoadError += OnLoadError; AddinManager.AddinLoaded += OnLoad; AddinManager.AddinUnloaded += OnUnload; try { Counters.RuntimeInitialization.Trace ("Initializing Addin Manager"); string configDir, addinsDir, databaseDir; GetAddinRegistryLocation (out configDir, out addinsDir, out databaseDir); AddinManager.Initialize (configDir, addinsDir, databaseDir); AddinManager.InitializeDefaultLocalizer (new DefaultAddinLocalizer ()); if (updateAddinRegistry) AddinManager.Registry.Update (null); setupService = new AddinSetupService (AddinManager.Registry); Counters.RuntimeInitialization.Trace ("Initialized Addin Manager"); PropertyService.Initialize (); //have to do this after the addin service and property service have initialized if (UserDataMigrationService.HasSource) { Counters.RuntimeInitialization.Trace ("Migrating User Data from MD " + UserDataMigrationService.SourceVersion); UserDataMigrationService.StartMigration (); } RegisterAddinRepositories (); Counters.RuntimeInitialization.Trace ("Initializing Assembly Service"); systemAssemblyService = new SystemAssemblyService (); systemAssemblyService.Initialize (); WebService.Initialize (); initialized = true; } catch (Exception ex) { Console.WriteLine (ex); AddinManager.AddinLoadError -= OnLoadError; AddinManager.AddinLoaded -= OnLoad; AddinManager.AddinUnloaded -= OnUnload; } finally { Counters.RuntimeInitialization.EndTiming (); } }
public static void Initialize (bool updateAddinRegistry) { if (initialized) return; Counters.RuntimeInitialization.BeginTiming (); SetupInstrumentation (); if (Platform.IsMac) InitMacFoundation (); // Set a default sync context if (SynchronizationContext.Current == null) SynchronizationContext.SetSynchronizationContext (new SynchronizationContext ()); AddinManager.AddinLoadError += OnLoadError; AddinManager.AddinLoaded += OnLoad; AddinManager.AddinUnloaded += OnUnload; try { Counters.RuntimeInitialization.Trace ("Initializing Addin Manager"); AddinManager.Initialize ( UserProfile.Current.ConfigDir, UserProfile.Current.LocalInstallDir, UserProfile.Current.CacheDir); AddinManager.InitializeDefaultLocalizer (new DefaultAddinLocalizer ()); if (updateAddinRegistry) AddinManager.Registry.Update (null); setupService = new AddinSetupService (AddinManager.Registry); Counters.RuntimeInitialization.Trace ("Initialized Addin Manager"); //have to do this after the addin service is initialized if (UserDataMigrationService.HasSource) { Counters.RuntimeInitialization.Trace ("Migrating User Data from MD " + UserDataMigrationService.SourceVersion); UserDataMigrationService.StartMigration (); } RegisterAddinRepositories (); Counters.RuntimeInitialization.Trace ("Initializing Assembly Service"); systemAssemblyService = new SystemAssemblyService (); systemAssemblyService.Initialize (); initialized = true; } catch (Exception ex) { Console.WriteLine (ex); AddinManager.AddinLoadError -= OnLoadError; AddinManager.AddinLoaded -= OnLoad; AddinManager.AddinUnloaded -= OnUnload; } finally { Counters.RuntimeInitialization.EndTiming (); } }
public static void Initialize (bool updateAddinRegistry) { if (initialized) return; Counters.RuntimeInitialization.BeginTiming (); SetupInstrumentation (); if (Platform.IsMac) InitMacFoundation (); // Set a default sync context if (SynchronizationContext.Current == null) SynchronizationContext.SetSynchronizationContext (new SynchronizationContext ()); // Hook up the SSL certificate validation codepath System.Net.ServicePointManager.ServerCertificateValidationCallback += delegate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) { if (sslPolicyErrors == SslPolicyErrors.None) return true; if (sender is WebRequest) sender = ((WebRequest)sender).RequestUri.Host; return WebCertificateService.GetIsCertificateTrusted (sender as string, certificate.GetPublicKeyString ()); }; AddinManager.AddinLoadError += OnLoadError; AddinManager.AddinLoaded += OnLoad; AddinManager.AddinUnloaded += OnUnload; //provides a development-time way to load addins that are being developed in a asperate solution var devAddinDir = Environment.GetEnvironmentVariable ("MONODEVELOP_DEV_ADDINS"); if (devAddinDir != null && devAddinDir.Length == 0) devAddinDir = null; try { Counters.RuntimeInitialization.Trace ("Initializing Addin Manager"); AddinManager.Initialize ( UserProfile.Current.ConfigDir, devAddinDir ?? UserProfile.Current.LocalInstallDir.Combine ("Addins"), devAddinDir ?? UserProfile.Current.CacheDir); AddinManager.InitializeDefaultLocalizer (new DefaultAddinLocalizer ()); if (updateAddinRegistry) AddinManager.Registry.Update (null); setupService = new AddinSetupService (AddinManager.Registry); Counters.RuntimeInitialization.Trace ("Initialized Addin Manager"); PropertyService.Initialize (); //have to do this after the addin service and property service have initialized if (UserDataMigrationService.HasSource) { Counters.RuntimeInitialization.Trace ("Migrating User Data from MD " + UserDataMigrationService.SourceVersion); UserDataMigrationService.StartMigration (); } RegisterAddinRepositories (); Counters.RuntimeInitialization.Trace ("Initializing Assembly Service"); systemAssemblyService = new SystemAssemblyService (); systemAssemblyService.Initialize (); initialized = true; } catch (Exception ex) { Console.WriteLine (ex); AddinManager.AddinLoadError -= OnLoadError; AddinManager.AddinLoaded -= OnLoad; AddinManager.AddinUnloaded -= OnUnload; } finally { Counters.RuntimeInitialization.EndTiming (); } }