/// <summary> /// main界面按钮跳转 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> void barButtonItem_ItemClick(object sender, ItemClickEventArgs e) { try { this.Cursor = Cursors.WaitCursor; VusermenuDto barItemMenu = GetMenuFromMenus(e.Item.Name); if (barItemMenu == null) { return; } if (barItemMenu.Menurule == null) { return; } Form form = this.MdiChildren.FirstOrDefault(f => f.GetType().FullName == barItemMenu.Menurule); if (form == null) { form = ServiceProviderManager.GetForm(barItemMenu.Menurule); } form.MdiParent = this; form.Show(); form.Activate(); } catch (Exception ex) { XtraMessageBox.Show(ex.Message); } finally { this.Cursor = Cursors.Default; } }
private static void ConfigureServices(ServiceCollection services) { //TODO:注入所有窗体 services.AddSingleton <Login>(); services.AddSingleton <UserCreateForm>(); services.AddSingleton <UserEditForm>(); services.AddSingleton <UserRoleCreateForm>(); services.AddSingleton <UserRoleEditForm>(); services.AddSingleton <RolePowerForm>(); ServiceProviderManager.Initialization(services); InitAutofac(); ServiceProviderManager.Builder(); string[] cmd = new string[] { "--Ice.ImplicitContext=Shared" }; var communicator = Ice.Util.initialize(ref cmd); var ic = communicator.getImplicitContext(); //注册应用服务客户端 services.AddSingleton(communicator) .AddRightsUploadService() .AddRightsQueryService(); }
static void Main(string[] args) { ServiceProviderManager.RegisterServices(); try { var stringProcessorService = ServiceProviderManager.GetService <IStringProcessorService>(); var testResults = stringProcessorService.ProcessStrings("AAAc91%cWwWkLq$1ci3_848v3d__K"); testResults.ToList().ForEach(result => Console.WriteLine($"Result is: {result}")); Console.ReadLine(); } catch (Exception ex) { Console.WriteLine($"Exception is: {ex}"); Console.ReadLine(); throw; } finally { ServiceProviderManager.DisposeServices(); } }
public static IGame Run() { return(ServiceProviderManager .Build() .GetService <IGame>()); }
public void Dispose() { ServiceProviderManager.DisposeServices(); }
public StringProcessorServiceFixture() { ServiceProviderManager.RegisterServices(); StringProcessorService = ServiceProviderManager.GetService <IStringProcessorService>(); }
protected override void Load(ContainerBuilder builder) { ServiceProviderManager.AddTransient(ThisAssembly); }
public BaseController() { serviceProvider = IoCContainer.Instance.Resolve <ServiceProviderManager>(); }