private bool Apply <T>(string key, T newValue) { if (Props.Get <T>(key, newValue).Equals(newValue)) { return(false); } Props.Set <T>(key, newValue); return(true); }
public override void Run() { ResourceService.RegisterNeutralImages(Properties.Resources.ResourceManager); ResourceService.RegisterNeutralStrings(Properties.Resources.ResourceManager); Workbench.WorkbenchInitialized += (sender, e) => { var wb = Workbench.Instance; wb.FormClosed += OnWorkbenchClosed; var mgr = ServiceRegistry.GetService <ViewContentManager>(); if (Props.Get(ScriptingConfigProperties.ShowIronPythonConsole, ScriptingConfigProperties.DefaultShowIronPythonConsole)) { _repl = mgr.OpenContent <IronPythonRepl>(ViewRegion.Bottom); } }; }
public override void Run() { ResourceService.RegisterNeutralImages(Properties.Resources.ResourceManager); ResourceService.RegisterNeutralStrings(Strings.ResourceManager); Workbench.WorkbenchInitialized += (sender, e) => { PreviewSettings.UseAjaxViewer = PropertyService.Get(ConfigProperties.PreviewViewerType, "AJAX") == "AJAX"; //NOXLATE PreviewSettings.UseLocalPreview = PropertyService.Get(ConfigProperties.UseLocalPreview, ConfigProperties.DefaultUseLocalPreview); var urlLauncher = ServiceRegistry.GetService <UrlLauncherService>(); var vcMgr = ServiceRegistry.GetService <ViewContentManager>(); ResourcePreviewerFactory.RegisterPreviewer("Maestro.Http", new LocalMapPreviewer(new DefaultResourcePreviewer(urlLauncher), urlLauncher, vcMgr)); //NOXLATE ResourcePreviewerFactory.RegisterPreviewer("Maestro.Rest", new LocalMapPreviewer(new DefaultResourcePreviewer(urlLauncher), urlLauncher, vcMgr)); //NOXLATE //A stub previewer does nothing, but will use local map previews for applicable resources if the configuration //property is set ResourcePreviewerFactory.RegisterPreviewer("Maestro.LocalNative", new LocalMapPreviewer(new StubPreviewer(), urlLauncher, vcMgr)); //NOXLATE ServiceRegistry.GetService <NewItemTemplateService>().InitUserTemplates(); var wb = Workbench.Instance; Themes.CurrentTheme = Props.Get <string>(ConfigProperties.SelectedTheme, ConfigProperties.DefaultSelectedTheme); var themeToApply = Themes.Get(Themes.CurrentTheme); if (themeToApply != null) { wb.ApplyTheme(themeToApply); } wb.FormClosing += new System.Windows.Forms.FormClosingEventHandler(OnWorkbenchClosing); wb.Text = "MapGuide Maestro"; //NOXLATE if (Props.Get(ConfigProperties.ShowMessages, true)) { vcMgr.OpenContent <MessageViewer>(ViewRegion.Bottom); } if (Props.Get(ConfigProperties.ShowOutboundRequests, true)) { vcMgr.OpenContent <OutboundRequestViewer>(ViewRegion.Bottom); } LoginCommand.RunInternal(true); }; }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); var viewer = Props.Get(ConfigProperties.PreviewViewerType, "AJAX"); //NOXLATE if (viewer.Equals("AJAX")) //NOXLATE { rdAjax.Checked = true; } else { rdFusion.Checked = true; } cmbTheme.DataSource = new string[] { ConfigProperties.DefaultSelectedTheme }.Concat(Themes.List).ToArray(); cmbTheme.SelectedItem = Props.Get <string>(ConfigProperties.SelectedTheme, ConfigProperties.DefaultSelectedTheme); var path = Props.Get(ConfigProperties.UserTemplatesDirectory, Path.Combine(FileUtility.ApplicationRootPath, "UserTemplates")); //NOXLATE txtTemplatePath.Text = path; var msg = Props.Get(ConfigProperties.ShowMessages, true); chkMessages.Checked = msg; var outb = Props.Get(ConfigProperties.ShowOutboundRequests, true); chkOutbound.Checked = outb; var totd = Props.Get(ConfigProperties.ShowTipOfTheDay, ConfigProperties.DefaultShowTipOfTheDay); chkShowTipOfTheDay.Checked = totd; txtFsPreview.Text = Props.Get(ConfigProperties.LocalFsPreviewPath, ConfigProperties.DefaultLocalFsPreviewPath); txtMgCooker.Text = Props.Get(ConfigProperties.MgCookerPath, ConfigProperties.DefaultMgCookerPath); txtRtMapInspector.Text = Props.Get(ConfigProperties.RtMapInspectorPath, ConfigProperties.DefaultRtMapInspectorPath); txtLiveMapEditor.Text = Props.Get(ConfigProperties.LiveMapEditorPath, ConfigProperties.DefaultLiveMapEditorPath); cmbOpenedColor.CurrentColor = Props.Get(ConfigProperties.OpenColor, Color.LightGreen); cmbModifiedColor.CurrentColor = Props.Get(ConfigProperties.DirtyColor, Color.Pink); }