private static string GetEditionName() { string editionName = string.Empty; string localApplicationDataPath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData); string settingsPath = Path.Combine(localApplicationDataPath, "MapSuiteGisEditor"); if (!Directory.Exists(settingsPath)) { editionName = new InfrastructureManager().EditionName; } else { string activeProfiler = Path.Combine(settingsPath, "ActiveProfiler.xml"); if (File.Exists(activeProfiler)) { System.Xml.Linq.XElement startUpSetting = System.Xml.Linq.XElement.Load(activeProfiler); if (startUpSetting.Element("EditionName") != null) { editionName = startUpSetting.Element("EditionName").Value; } } } return(editionName); }
static GisEditor() { serializer = new GisEditorGeoSerializer(); infrastructureManager = CreateManager <InfrastructureManager>(); Collection <Manager> managers = infrastructureManager.GetManagers(); ProjectManager.CurrentProjectPlugin = ProjectManager.GetProjectPlugins().OrderBy(p => p.Index).FirstOrDefault(); managers.OfType <PluginManager>().ForEach(m => m.GetPlugins()); infrastructureManager.ApplySettings(managers.OfType <PluginManager>().SelectMany(m => m.GetPlugins())); }
private static T GetManager <T>(ref T manager) where T : Manager { if (manager == null) { var foundManagers = infrastructureManager.GetManagers().OfType <T>().ToArray(); if (foundManagers.Length > 0) { manager = foundManagers.First(); InfrastructureManager.ApplySettings(manager); } } return(manager); }