public CatalogController( ICatalogRepository repository, ITaskRepository taskRepository, ICatalogView catalogView, INewCatalogView newCatalogView, INewSupplyView newSupplyView, INewHardwareView newHardwareView, IEditSupplyView editSupplyView, IEditHardwareView editHardwareView, INewHardwareSupplyView newHardwareSupplyView, IEditHardwareSupplyView editHardwareSupplyView, IImportHardwareView importHardwareView, ILoadingView loadingView) { this.catalogView = catalogView; this.newCatalogView = newCatalogView; this.newSupplyView = newSupplyView; this.newHardwareView = newHardwareView; this.editSupplyView = editSupplyView; this.editHardwareView = editHardwareView; this.newHardwareSupplyView = newHardwareSupplyView; this.editHardwareSupplyView = editHardwareSupplyView; this.importHardwareView = importHardwareView; this.loadingView = loadingView; this.repository = repository; this.taskRepository = taskRepository; }
public ProjectController( IProjectView projectView, INewProjectView newProjectView, IProjectRepository projectRepository, IDealRepository dealRepository, INewProjectSupplyView newProjectSupplyView, INewProjectHardwareView newProjectHardwareView, IEditProjectSupplyView editProjectSupplyView, IEditProjectHardwareView editProjectHardwareView, INewProjectFrameView newProjectFrameView, IEditProjectHardwareSupplyView editProjectHardwareSupplyView, ILoadingView loadingView, ICatalogRepository catalogRepository, ITaskRepository taskRepository) { this.projectView = projectView; this.newProjectView = newProjectView; this.projectRepository = projectRepository; this.dealRepository = dealRepository; this.newProjectSupplyView = newProjectSupplyView; this.newProjectHardwareView = newProjectHardwareView; this.editProjectHardwareView = editProjectHardwareView; this.editProjectSupplyView = editProjectSupplyView; this.newProjectFrameView = newProjectFrameView; this.editProjectHardwareSupplyView = editProjectHardwareSupplyView; this.loadingView = loadingView; this.catalogRepository = catalogRepository; this.taskRepository = taskRepository; }
public LoadingPresenter(/*IProductService s*/IProductRepository r, ILoadingView v, LoadingModel m) { //Service = s; Repository = r; Model = m; View = v; View.Products = new Dictionary<string, ProductEntity>(); }
public DealController(IDealRepository dealRepository, ITaskRepository taskRepository, IDealView dealView, INewDealView newDealView, ILoadingView loadingView) { this.dealView = dealView; this.newDealView = newDealView; this.loadingView = loadingView; this.taskRepository = taskRepository; this.dealRepository = dealRepository; }
public Task Load(ILoadingView view) { return(Task.Run(() => { try { Program.Discord = new DiscordWrapper(); Program.Discord.Error += Discord_Error; } catch (Exception ex) { Log.Warn($"Discord Creation Error: {ex.Message}", ex); } })); }
protected override async Task <Window> Load(ILoadingView loadingView) { try { var replayClient = new ReplayClient(); Program.Client = replayClient; Program.IsHost = true; loadingView.UpdateStatus("Loading Replay.."); ReplayReader reader = null; ReplayEngine engine = null; try { reader = ReplayReader.FromStream(File.OpenRead(_replayPath)); engine = new ReplayEngine(reader, replayClient); loadingView.UpdateStatus("Loading Game..."); var game = GameManager.Get().GetById(reader.Replay.GameId); loadingView.UpdateStatus("Loading Game Engine..."); Program.CurrentOnlineGameName = game.Name; Program.GameEngine = new GameEngine(engine, game, reader.Replay.User); } catch { reader?.Dispose(); engine?.Dispose(); throw; } var dispatcher = Dispatcher.CurrentDispatcher; Window window = null; await dispatcher.InvokeAsync(() => { window = WindowManager.PlayWindow = new PlayWindow(); window.Closed += PlayWindow_Closed; window.Show(); }, DispatcherPriority.Background); return(window); } catch (UserMessageException) { throw; } catch (Exception e) { var msg = $"Error launching replay from {_replayPath}: {e.Message}"; Log.Warn(msg, e); throw new UserMessageException(UserMessageExceptionMode.Blocking, msg, e); } }
protected override async Task <Window> Load(ILoadingView loadingView) { try { await new GameTableLauncher().Launch(this.hostPort, this.gameId); return(WindowManager.PlayWindow); } catch (Exception e) { var msg = "Couldn't host local game"; Log.Warn(msg, e); throw new UserMessageException(UserMessageExceptionMode.Blocking, msg, e); } }
private async UniTask <AsyncUnit> StartLoading(ILoadingView loadingView, List <ICommand> commands, CancellationToken cancellationToken) { Container.Rebind <ILoadingView>().FromInstance(loadingView).AsTransient(); Container.Rebind <List <ICommand> >().FromInstance(commands).AsTransient(); var viewManager = Container.Resolve <ILoadingViewManager>(); //Here's a bit magic to unload from memory view Container.Unbind <ILoadingView>(); Container.Unbind <List <ICommand> >(); await viewManager.StartLoading(cancellationToken); return(AsyncUnit.Default); }
IEnumerator Start() { DontDestroyOnLoad(this.gameObject); mLoadingView = YarLiongFactory.GetLoadingView(); mModel = YarLiongFactory.MainGameModel; if (mLoadingView != null) { yield return(StartCoroutine(mLoadingView.Init())); } if (mSceneController != null) { yield return(StartCoroutine(mSceneController.Init())); } }
protected override async Task <Window> Load(ILoadingView loadingView) { try { var fn = Path.GetFileName(DeckPath); loadingView.UpdateStatus($"Loading Deck '{fn}'..."); await Task.Run(() => { Deck = (DeckPath == null) ? null : new MetaDeck(DeckPath); }); Window win = null; await Dispatcher.CurrentDispatcher.InvokeAsync(() => { win = new DeckBuilderWindow(Deck, true); win.WindowStartupLocation = WindowStartupLocation.CenterScreen; win.Show(); }, DispatcherPriority.Background); return(win); } catch (Exception e) { string msg; if (string.IsNullOrWhiteSpace(DeckPath)) { msg = $"Deck editor failed to launch: {e.Message}"; } else { msg = $"Deck editor failed to launch '{DeckPath}': {e.Message}"; } Log.Warn(msg, e); throw new UserMessageException( UserMessageExceptionMode.Blocking, msg, e ); } }
public async Task Load(ILoadingView view) { foreach (var loader in Loaders) { Log.Info($"Loading {loader.Name}"); view.UpdateStatus($"Loading {loader.Name}"); try { await loader.Load(view); } catch (Exception ex) { var msg = $"Error loading {loader.Name}: {ex.Message}"; Log.Error(msg, ex); throw new UserMessageException( UserMessageExceptionMode.Blocking, msg, ex ); } } }
public async Task <bool> Launch(ILoadingView view) { Dispatcher.CurrentDispatcher.VerifyAccess(); view.UpdateStatus($"Launching {Name}..."); var window = await Load(view); if (window == null) { Log.Warn("No window created"); return(false); } // do async so can run in backround await Dispatcher.Yield(DispatcherPriority.Background); Application.Current.MainWindow = window; await Task.Delay(300); return(true); }
public Task Load(ILoadingView view) { return(Task.Run(LoadSync)); }
public LoadingViewMediator(ILoadingView view) : base(view) { this.Target = view; }
public ActionExecutor(ILoadingView loadingView, IMessageBoxPresenter messageBoxPresenter, IOptions <ActionExecutorOptions> options) { _loadingView = loadingView ?? throw new ArgumentNullException(nameof(loadingView)); _options = options ?? throw new ArgumentNullException(nameof(options)); _messageBoxPresenter = messageBoxPresenter ?? throw new ArgumentNullException(nameof(messageBoxPresenter)); }
public LoadingViewManager(ILoadingView loadingView, ILoadingManager loadingManager) { this.loadingView = loadingView; this.loadingManager = loadingManager; }
private void CreateLoadingView() { loadingView = UICreator .GetInstance() .Create <LoadingText>(UICanvasLayer.Background, UIIndex.End); }
protected abstract Task <Window> Load(ILoadingView loadingView);
public TaskController(ITaskRepository taskRepository, ILoadingView loadingView, ITasksView tasksView) { this.taskRepository = taskRepository; this.loadingView = loadingView; this.tasksView = tasksView; }
protected override async Task <Window> Load(ILoadingView loadingView) { var hostedGame = _game; try { Program.CurrentHostedGame = hostedGame; var password = string.Empty; if (Program.IsHost = _isHost) { password = hostedGame.Password; } else { if (hostedGame.HasPassword) { var dlg = new InputDlg("Password", "Please enter this games password", ""); password = dlg.GetString(); } } if (hostedGame.Source == HostedGameSource.Online) { Program.CurrentOnlineGameName = hostedGame.Name; } loadingView.UpdateStatus("Loading game"); var gm = GameManager.Get(); var game = GameManager.Get().GetById(hostedGame.GameId); if (game == null) { var msg = $"Game {hostedGame.GameName}({hostedGame.Id}) could not be found."; throw new UserMessageException(UserMessageExceptionMode.Blocking, msg); } loadingView.UpdateStatus("Building engine"); Program.GameEngine = new GameEngine(game, _username, _spectate, password); loadingView.UpdateStatus($"Connecting to {hostedGame.HostAddress}"); await Task.Delay(100); Program.Client = await Connect(hostedGame.Host, hostedGame.Port); if (Program.Client == null) { var msg = $"Unable to connect to {hostedGame.Name} at {hostedGame.HostAddress}"; throw new UserMessageException(UserMessageExceptionMode.Blocking, msg); } Window window = null; await Dispatcher.CurrentDispatcher.InvokeAsync(() => { window = WindowManager.PlayWindow = new PlayWindow(); window.Closed += PlayWindow_Closed; window.Show(); }, DispatcherPriority.Background); return(window); } catch (Exception e) { var msg = $"Error joining game {hostedGame.Name}: {e.Message}"; Log.Warn(msg, e); throw new UserMessageException(UserMessageExceptionMode.Blocking, msg, e); } }
public LoadingViewMediator(ILoadingView view) : base(view) { this.Target = view; }
public async Task Load(ILoadingView view) { await Task.Run(() => { LoadConfig(); }); }