public static void DataSyncSettingClick(IocManager iocManager, IFormIOSchemeManager formIOSchemeManager, IDataSyncSettingsManager dataSyncSettingManager, ILogger logger) { DialogHybirdForm <FormIOControl> dialog = new DialogHybirdForm <FormIOControl>(iocManager, typeof(ZtgeoGisHybridMoudle).Assembly, new string[] { "WebViews", "FormIO", "FormIoWebView.html" }); dialog.Size = new Size(1260, 760); dialog.FormBorderStyle = FormBorderStyle.FixedToolWindow; dialog.StartPosition = FormStartPosition.CenterScreen; string component = formIOSchemeManager.GetFormIOSchemeById(1); string data = dataSyncSettingManager.GetDataSyncSettings(); ((FormIOControl)dialog.hybridControl).SetFormIOComponentAndData(component, data); ((FormIOControl)dialog.hybridControl).OnSave = (control, submissionData) => { try { dynamic subdata = JsonConvert.DeserializeObject <dynamic>(submissionData); dataSyncSettingManager.SetDataSyncSettings(subdata); } catch (Exception ex) { EventBus.Default.Trigger(new NonUIExceptionEventData { UnhandledExceptionEventArgs = new UnhandledExceptionEventArgs(ex, false) }); } }; dialog.ShowDialog(); }
public void Excute() { DialogHybirdForm <MenuSettingControl> dialog = new DialogHybirdForm <MenuSettingControl>(iocManager, typeof(ZtgeoGISDesktopMoudle).Assembly, new string[] { "WebViews", "MenuSetting", "index.html" }); dialog.Size = new Size(1260, 560); dialog.FormBorderStyle = FormBorderStyle.FixedToolWindow; dialog.StartPosition = FormStartPosition.CenterScreen; dialog.ShowDialog(); }
public static void ShowDialog(IocManager iocManager, IFormIOSchemeManager formIOSchemeManager, ILoginManager loginManager) { DialogHybirdForm <FormIOControl> dialog = new DialogHybirdForm <FormIOControl>(iocManager, typeof(ZtgeoGisHybridMoudle).Assembly, new string[] { "WebViews", "FormIO", "FormIoWebView.html" }); dialog.Size = new Size(550, 520); dialog.MaximizeBox = false; dialog.MinimizeBox = false; dialog.StartPosition = FormStartPosition.CenterScreen; dialog.ShowIcon = true; dialog.Icon = new Icon(AssemblyResource.GetResourceStream(typeof(ZtgeoGISDesktopMoudle).Assembly, "ZtgeoGISDesktop.Icons.login.ico")); string component = formIOSchemeManager.GetFormIOSchemeById(2); ((FormIOControl)dialog.hybridControl).SetFormIOComponentAndData(component, "{}"); ((FormIOControl)dialog.hybridControl).OnSave = (control, submissionData) => { try { dynamic subdata = JsonConvert.DeserializeObject <dynamic>(submissionData); var authenticateResultModel = loginManager.Login(new Ztgeo.Gis.Runtime.Authorization.AuthenticateModel { UserNameOrEmailAddress = subdata.data.UserName, Password = subdata.data.Password }, (bool)subdata.data.IsServerless); if (authenticateResultModel != null && authenticateResultModel.ShouldResetPassword) { MessageBox.Show("密码需要重置,请联系管理员"); return; } if (authenticateResultModel != null) { dialog.DialogResult = DialogResult.OK; dialog.Close(); } } catch (Exception ex) { EventBus.Default.Trigger(new NonUIExceptionEventData { UnhandledExceptionEventArgs = new UnhandledExceptionEventArgs(ex, false) }); } }; if (dialog.ShowDialog() == DialogResult.Cancel) { System.Environment.Exit(0); } }
public override void SetMenus(IMenuDefinitionContext context) { var settingPageMenu = context.CreateMenu(MainFormMenuNames.SettingPageMenu, MenuType.Page, "设置", "", null, AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.Setting.png")); var systemSettingGroup = settingPageMenu.CreateChildMenu(MainFormMenuNames.SystemSettingGroupMenu, MenuType.Group, "系统设置"); var uiDesign = systemSettingGroup.CreateChildMenu(MainFormMenuNames.SystemSettingGroup_UiDesign, MenuType.Button, "界面设置", "", null , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.UIDesign.png"), menuEvent: m => { }); //var backend = systemSettingGroup.CreateChildMenu(MainFormMenuNames.SystemSettingGroup_Backend, MenuType.Button, "后台设置", "", null // , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.backend.png")); var menuOrder = systemSettingGroup.CreateChildMenu(MainFormMenuNames.SystemSettingGroup_MenuOrderSetting, MenuType.Button, "菜单设置", "", null , AssemblyResource.GetResourceImage(Assembly.GetExecutingAssembly(), "ZtgeoGISDesktop.Icons.MenuOrderSetting.png"), menuEvent: m => { DialogHybirdForm <MenuSettingControl> dialog = new DialogHybirdForm <MenuSettingControl>(iocManager, typeof(ZtgeoGISDesktopMoudle).Assembly, new string[] { "WebViews", "MenuSetting", "index.html" }); dialog.Size = new Size(1260, 560); dialog.FormBorderStyle = FormBorderStyle.FixedToolWindow; dialog.StartPosition = FormStartPosition.CenterScreen; dialog.ShowDialog(); }); }