void showErrorModelCommand_BeforeQueryStatus(object sender, EventArgs e) { var atv = ActiveTextView; if (MenuProxy != null && atv != null) { var visible = MenuProxy.ShowErrorModelCommandEnabled(atv); toggleBVDCommand.Visible = visible; } }
void compileCommand_BeforeQueryStatus(object sender, EventArgs e) { var atv = ActiveTextView; if (MenuProxy != null && atv != null) { var enabled = MenuProxy.CompileCommandEnabled(atv); compileCommand.Enabled = enabled; } }
private void toggleAutomaticInductionCommand_BeforeQueryStatus(object sender, EventArgs e) { var atv = ActiveTextView; if (MenuProxy != null && atv != null) { var visible = MenuProxy.AutomaticInductionCommandEnabled(atv); toggleAutomaticInductionCommand.Visible = visible; } }
private void toggleMoreAdvancedSnapshotVerificationCommand_BeforeQueryStatus(object sender, EventArgs e) { var atv = ActiveTextView; if (MenuProxy != null && atv != null) { var visible = MenuProxy.MoreAdvancedSnapshotVerificationCommandEnabled(atv); toggleMoreAdvancedSnapshotVerificationCommand.Visible = visible; } }
void diagnoseTimeoutsCommand_BeforeQueryStatus(object sender, EventArgs e) { var atv = ActiveTextView; if (MenuProxy != null && atv != null) { var visible = MenuProxy.DiagnoseTimeoutsCommandEnabled(atv); diagnoseTimeoutsCommand.Visible = visible; } }
void ToggleAutomaticInductionCallback(object sender, EventArgs e) { var atv = ActiveTextView; if (MenuProxy != null && atv != null) { var nowAutomatic = MenuProxy.ToggleAutomaticInduction(atv); toggleAutomaticInductionCommand.Text = (nowAutomatic ? "Disable" : "Enable") + " automatic induction"; } }
void menuCommand_BeforeQueryStatus(object sender, EventArgs e) { var atv = ActiveTextView; if (MenuProxy != null && atv != null) { var isActive = MenuProxy.MenuEnabled(atv); menuCommand.Visible = isActive; menuCommand.Enabled = isActive; } }
void runResolverCommand_BeforeQueryStatus(object sender, EventArgs e) { var atv = ActiveTextView; if (MenuProxy != null && atv != null) { var enabled = MenuProxy.RunResolverCommandEnabled(atv); runResolverCommand.Visible = enabled; runResolverCommand.Enabled = enabled; } }
void stopVerifierCommand_BeforeQueryStatus(object sender, EventArgs e) { var atv = ActiveTextView; if (MenuProxy != null && atv != null) { var enabled = MenuProxy.StopVerifierCommandEnabled(atv); stopVerifierCommand.Visible = enabled; stopVerifierCommand.Enabled = enabled; } }
void ToggleMoreAdvancedSnapshotVerificationCallback(object sender, EventArgs e) { var atv = ActiveTextView; if (MenuProxy != null && atv != null) { var mode = MenuProxy.ToggleMoreAdvancedSnapshotVerification(atv); toggleSnapshotVerificationCommand.Text = (mode != 0 ? "Disable" : "Enable") + " on-demand re-verification"; toggleMoreAdvancedSnapshotVerificationCommand.Text = (mode == 2 ? "Disable" : "Enable") + " more advanced on-demand re-verification"; } }
public override void Execute(INotification notification) { OrderProxy orderProxy = PureMVC.Patterns.Facade.Instance.RetrieveProxy("OrderProxy") as OrderProxy; MenuProxy menuProxy = PureMVC.Patterns.Facade.Instance.RetrieveProxy("MenuProxy") as MenuProxy; // WaiterProxy waiterProxy = PureMVC.Patterns.Facade.Instance.RetrieveProxy("WaiterProxy") as WaiterProxy; Debug.Log(notification.Type); if (notification.Type == "Get") { Order order = new Order(notification.Body as ClientItem, menuProxy.Menus); orderProxy.AddOrder(order); SendNotification(OrderSystemEvent.UPMENU, order); // waiterProxy.ChangeWaiter();//上菜改变服务员的属性 } else if (notification.Type == "Exit") //删除菜单 { Order order = new Order(notification.Body as ClientItem, menuProxy.Menus); orderProxy.RemoveOrder(order); } }
static void Main(string[] args) { ConfigDcConfig.GetServerName(out string serverName); Util.ConfigDc.ProtoProxy.ServerAddressReply serverAddressReply = ConfigDcUtilClientImp.GetServerAddress(serverName).Result; string Ip = serverAddressReply.ServerIp; int Port = serverAddressReply.ServerPort; Console.Title = "B2B监听服务"; try { IServiceCollection services = new ServiceCollection(); #region EF Context注册 services.AddDbContext <B2bDbContext>(options => options.UseSqlServer ( ConfigDcUtilClientImp.GetDbConnectionConfig().GetAwaiter().GetResult() ) ); ConsoleExtendsions.WriteLineSuccess("EF Context 注册成功... "); #endregion #region DI注入 IServiceProvider serviceProvider = ServerRegisterModuleIoc.GrpcServerModule.ServiceDIRegister(services); ConsoleExtendsions.WriteLineSuccess("DI 注入成功... "); #endregion #region 视图重置 string[] files = FileHelper.GetFiles("cfgViews"); List <ViewEntity> viewEntityList = new List <ViewEntity>(); Console.WriteLine(); Console.WriteLine($"共检测到 {files.Length} 个视图需要重置,正在重置..."); CreateInitView createInitView = new CreateInitView(serviceProvider.GetService <DbContext>()); for (int i = 0; i < files.Length; i++) { string fileContent = FileHelper.FileReadAllText(files[i]); ViewEntity v = new ViewEntity(FileHelper.GetFileName(files[i]), fileContent); createInitView.RunInitCreate(v); ConsoleExtendsions.WriteLineSuccess($"{i + 1}. {v.viewName} 视图重置成功... "); } ConsoleExtendsions.WriteLineSuccess("重置数据库视图完成... "); Console.WriteLine(); #endregion #region Oracle 配置 DbStartConfig.DbOracleConnectionString = ConfigDcUtilClientImp.GetDbConnectionConfig("OracleDbConnectionString").GetAwaiter().GetResult(); #endregion Server server = new Server() { Ports = { new ServerPort(Ip, Port, ServerCredentials.Insecure) }, Services = { MenuProxy.BindService(new MenuProxyService(() => serviceProvider.GetService <IBaseService <B2B_MENU> >())), LookUpValuesAllProxy.BindService(new LookUpValuesAllProxyService(() => serviceProvider.GetService <IBaseService <B2B_LOOKUP_VALUES_ALL> >())), LookUpValuesProxy.BindService(new LookUpValuesProxyService(() => serviceProvider.GetService <IB2B_LOOKUP_VALUES_Service>())), MessagesProxy.BindService(new MessagesProxyService(() => serviceProvider.GetService <IB2B_MESSAGES_Service>())), UserProxy.BindService(new UserProxyService(() => serviceProvider.GetService <IB2B_USER_Service>())), UserMenuProxy.BindService(new UserMenuProxyService(() => serviceProvider.GetService <IB2B_USER_MENU_Service>())), MenuFunctionProxy.BindService(new MenuFunctionProxyService(() => serviceProvider.GetService <IBaseService <B2B_MENU_FUNCTION> >())), UserFunctionProxy.BindService(new UserFunctionProxyService(() => serviceProvider.GetService <IB2B_USER_FUNCTION_Service>())), } }; server.Start(); ConsoleExtendsions.WriteLineSuccess("gRPC 服务启动成功,正在监听:port " + Port); Console.WriteLine("任意键退出..."); Console.ReadKey(); server.ShutdownAsync().Wait(); } catch (Exception ex) { ConsoleExtendsions.WriteLineError($"gRPC 服务监听启动失败!失败 port:{Port}!错误详细信息:{ex.GetBaseException().ToString()}"); Console.WriteLine("任意键退出..."); Console.ReadKey(); logger.Error(ex: ex); } }