Пример #1
0
 internal static void ApplyEditorDefaults()
 {
     Props.Set(ConfigProperties.PreviewLocale, DefaultPreviewLocale);
     Props.Set(ConfigProperties.ValidateOnSave, DefaultValidateOnSave);
     Props.Set(ConfigProperties.XsdSchemaPath, DefaultXsdSchemaPath);
     Props.Set(ConfigProperties.UseLocalPreview, DefaultUseLocalPreview);
     Props.Set(ConfigProperties.UseGridStyleEditor, DefaultUseGridStyleEditor);
 }
        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);
        }
Пример #3
0
 internal static void ApplyGeneralDefaults()
 {
     Props.Set(ConfigProperties.SelectedTheme, DefaultSelectedTheme);
     Props.Set(ConfigProperties.PreviewViewerType, DefaultPreviewViewerType);
     Props.Set(ConfigProperties.UserTemplatesDirectory, DefaultUserTemplatesDirectory);
     Props.Set(ConfigProperties.ShowMessages, DefaultShowMessages);
     Props.Set(ConfigProperties.ShowOutboundRequests, DefaultShowOutboundRequests);
     Props.Set(ConfigProperties.OpenColor, DefaultOpenColor);
     Props.Set(ConfigProperties.DirtyColor, DefaultDirtyColor);
     Props.Set(ConfigProperties.MgCookerPath, DefaultMgCookerPath);
     Props.Set(ConfigProperties.RtMapInspectorPath, DefaultRtMapInspectorPath);
     Props.Set(ConfigProperties.LocalFsPreviewPath, DefaultLocalFsPreviewPath);
     Props.Set(ConfigProperties.ShowTipOfTheDay, DefaultShowTipOfTheDay);
     Props.Set(ConfigProperties.LiveMapEditorPath, DefaultLiveMapEditorPath);
 }
Пример #4
0
        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);
        }