예제 #1
0
    public async Task <RouteResult> RouteAsync(RouteRequest routeRequest)
    {
        var routeWorkflow =
            RouteWorkflowTask.Go(routeRequest, _routeEntryRegistry, _routeAuthorizationManager, this, _logger);

        return(await routeWorkflow.RouteResult);
    }
    private async Task <RouteResult> RunRouteWorkflow(TestParameters parameters)
    {
        var sut = new RouteWorkflowTask(parameters.RouteRequest,
                                        _fixture.GetMock <IRouteEntryRegistry>().Object,
                                        _fixture.GetMock <IRouteAuthorizationManager>().Object,
                                        _fixture.GetMock <IRouterService>().Object,
                                        _logger);

        var routeResult = await sut.GoAsync();

        return(routeResult);
    }
    public static RouteWorkflowTask Go(
        RouteRequest routeRequest,
        IRouteEntryRegistry routeEntryRegistry,
        IRouteAuthorizationManager routeAuthorizationManager,
        IRouterService routerService,
        ILogger logger)
    {
        var workflow = new RouteWorkflowTask(routeRequest, routeEntryRegistry, routeAuthorizationManager,
                                             routerService,
                                             logger);

        workflow.RouteResult = workflow.GoAsync();
        return(workflow);
    }
예제 #4
0
    public void ActivateExistingRouteWorkflow(RouteWorkflowTask routeWorkflowTask)
    {
        foreach (var viewportAdapter in _viewportAdapters)
        {
            foreach (var activeRouteWorkflow in viewportAdapter.Value.GetActiveRouteWorkflows())
            {
                if (activeRouteWorkflow == routeWorkflowTask)
                {
                    viewportAdapter.Value.Activate(activeRouteWorkflow);
                    _logger.Information(
                        $"Found RouteWorkflowTask for URI: {routeWorkflowTask.Uri} with Guid: {activeRouteWorkflow.RoutingWorkflowId}.");
                    return;
                }
            }
        }

        //If we get here, then no matching RouteWorkflowTask was found in all the viewport adapters.
        _logger.Information($"Existing RouteWorkflowTask for URI: {routeWorkflowTask.Uri} not found.");
    }
예제 #5
0
 public override void Activate(RouteWorkflowTask activeRouteWorkflow)
 {
     throw new System.NotImplementedException();
 }
예제 #6
0
 public abstract void AddControl(UIElement control, RouteWorkflowTask routeWorkflowTask);
 public override void Activate(RouteWorkflowTask activeRouteWorkflow)
 {
     //There is nothing to do here since a ContentControl is showing its only content already.
 }
예제 #8
0
 public abstract void                     Activate(RouteWorkflowTask activeRouteWorkflow);
예제 #9
0
 public abstract void                     CloseScreen(RouteWorkflowTask workflow);
 public override void AddControl(UIElement control, RouteWorkflowTask routeWorkflowTask)
 {
     _views.Add(control);
     _routeWorkflowTasks.Add(routeWorkflowTask);
 }
 public override void CloseScreen(RouteWorkflowTask workflow)
 {
     throw new NotImplementedException();
 }
 public override void AddControl(UIElement control, RouteWorkflowTask routeWorkflowTask)
 {
     _contentControl.Content = control;
     _routeWorkflowTask      = routeWorkflowTask;
 }
 public override void Activate(RouteWorkflowTask activeRouteWorkflow)
 {
     _tabControl.SelectedItem = activeRouteWorkflow.Controller;
 }
예제 #14
0
 public override void AddControl(UIElement control, RouteWorkflowTask routeWorkflowTask)
 {
     throw new System.NotImplementedException();
 }
 public override void CloseScreen(RouteWorkflowTask workflow)
 {
     _contentControl.Content = null;
 }
 public override void CloseScreen(RouteWorkflowTask workflow)
 {
     _window.Close();
 }
 public override void AddControl(UIElement control, RouteWorkflowTask routeWorkflowTask)
 {
     _routeWorkflowTask = routeWorkflowTask;
     _window.Content    = control;
     _window.Show();
 }
 public override void Activate(RouteWorkflowTask activeRouteWorkflow)
 {
     _window.BringWindowToFront(null);
 }