public async Task multithreaded_simulation_should_be_successful()
        {
            IOperationManager <SessionState, TaskState> operationManager = CreateOperationManager();

            Enumerable
            .Range(1, 20)
            .Select(i => operationManager.CreateOperation(new OperationId(i.ToString()), new TaskState {
                Number = i
            }))
            .ToArray();

            await operationManager.Start(new ExecutionOptions <SessionState, TaskState>()
            {
                ExecutorExtended    = new MultiplyByTwoExt(),
                MaxConcurrencyLevel = 5,
                OnOperationFinished = OnOperationFinished,
                OnSessionFinished   = OnSessionFinished
            });

            await operationManager.SessionCompletion;

            var session = operationManager.SessionWithOperations;

            session.Status.Should().Be(OperationStatus.Finished);

            var operation = operationManager.GetOperation(new OperationId("2")) !;

            operation.State.Result.Should().Be(4);

            var metrics = session.GetMetrics();

            metrics.Should().NotBeNull();
        }
Ejemplo n.º 2
0
        private async Task TestManager(IOperationManager manager)
        {
            await manager.Initialize();

            Assert.IsNotNull(await manager.Settings);
            {
                Package <BaseOperation> sample = new Package <BaseOperation>(
                    new SimpleCommandLineOperation()
                    .Use(new CommandLineTemplate()))
                {
                    Metadata = new PackageMetadata
                    {
                        Name = nameof(sample)
                    }
                };
                await manager.SetValue(nameof(sample), sample);

                Assert.IsTrue(await manager.HasKey(nameof(sample)));
                Package <BaseOperation>?reget = await manager.GetValue(nameof(sample));

                Assert.IsNotNull(reget);
                Assert.AreEqual(nameof(sample), reget?.Metadata?.Name);
                Assert.IsInstanceOfType(reget !.Data, typeof(SimpleCommandLineOperation));

                await manager.SetValue(nameof(sample), null);

                Assert.IsFalse(await manager.HasKey(nameof(sample)));
            }
        }
Ejemplo n.º 3
0
        public MainPresenter(ICalculatorForm view, IMessageService messageService, IOperationManager manager)
        {
            _view           = view;
            _messageService = messageService;
            _manager        = manager;

            _view.EqualClick += _view_EqualClick;
        }
Ejemplo n.º 4
0
        //"test_env_FARM"
        public AceLoadBalancer_Anm_v41(string username, string password, string chassisIp = null)
        {
            _proxy = new OperationManagerClient("OperationManagerPort");
            _username = username;
            _password = password;
            _chassisIp = chassisIp;

            ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
        }
Ejemplo n.º 5
0
 public OperationController(AddOperationProcessorBase operatorProcessorParam, ISourceManager sourceManagerParam,
                            ICurrencyManager currencyManagerParam, ICategoryManager categoryManagerParam, IOperationManager operationManagerParam)
 {
     _operatorProcessor = operatorProcessorParam;
     _sourceManager     = sourceManagerParam;
     _currencyManager   = currencyManagerParam;
     _categoryManager   = categoryManagerParam;
     _operationManager  = operationManagerParam;
 }
        public CenterViewModel(ILifetimeScope lifetimeScope, Dispatcher dispatcher, IOperationManager manager, LocLocalizer localizer, IDialogCoordinator dialogCoordinator,
                               IMainWindowCoordinator mainWindow, ProjectFileWorkspace workspace)
            : base(lifetimeScope, dispatcher)
        {
            Receive <IncommingEvent>(e => e.Action());

            Views          = this.RegisterUiCollection <ProjectViewContainer>(nameof(Views)).AndAsync();
            CurrentProject = RegisterProperty <int?>(nameof(CurrentProject));

            AddProject(new Project().WithProjectName("Dummy"));
Ejemplo n.º 7
0
        public static string Q_OperationCheck(this IOperationManager opm, IEntitySchema es, int objectId)
        {
            List <int>    userIdByDeptId;
            string        str2;
            IUserIdentity currentUser = opm.CurrentUser;

            if (currentUser == null)
            {
                throw new ApplicationException("登录用户为空,无法判断权限");
            }
            EntityPrivilegeEnum enum2 = opm.TryCanOperation(currentUser.User_ID, es.EntityId, EntityOperationEnum.Query);
            string str = "";

            if ((enum2 == EntityPrivilegeEnum.NoPermission) && !opm.CheckHasSharedPrivilege(objectId, es.EntityName, EntityOperationEnum.Query))
            {
                throw new ApplicationException(string.Format("当前登录的用户没有对 {0} 的查询权限", es.EntityName));
            }
            if (es.PrivilegeModel() == King.Framework.EntityLibrary.PrivilegeModel.Organization)
            {
                if ((enum2 != EntityPrivilegeEnum.AllRights) && !opm.CheckHasSharedPrivilege(objectId, es.EntityName, EntityOperationEnum.Query))
                {
                    throw new ApplicationException(string.Format("当前登录的用户没有对 {0} 的查询权限", es.EntityName));
                }
                return("");
            }
            if ((enum2 == EntityPrivilegeEnum.Personal) && !opm.CheckHasSharedPrivilege(objectId, es.EntityName, EntityOperationEnum.Query))
            {
                str = string.Format(" ( it.OwnerId = {0} )", currentUser.User_ID);
            }
            if ((enum2 == EntityPrivilegeEnum.Department) && !opm.CheckHasSharedPrivilege(objectId, es.EntityName, EntityOperationEnum.Query))
            {
                userIdByDeptId = opm.GetUserIdByDeptId(new int[] { currentUser.Department_ID.Value });
                if (userIdByDeptId.Count == 0)
                {
                    userIdByDeptId.Add(-2147483647);
                }
                str2 = string.Join <int>(" , ", userIdByDeptId);
                str2 = "{ " + str2 + " }";
                str  = string.Format(" ( it.OwnerId in {0} )", str2);
            }
            if ((enum2 == EntityPrivilegeEnum.DepartmentAndSubSector) && !opm.CheckHasSharedPrivilege(objectId, es.EntityName, EntityOperationEnum.Query))
            {
                List <int> subDeptIds = opm.GetSubDeptIds(currentUser.Department_ID);
                subDeptIds.Add(currentUser.Department_ID.Value);
                userIdByDeptId = opm.GetUserIdByDeptId(subDeptIds.ToArray());
                if (userIdByDeptId.Count == 0)
                {
                    userIdByDeptId.Add(-2147483647);
                }
                str2 = string.Join <int>(" , ", userIdByDeptId);
                str2 = "{ " + str2 + " }";
                str  = string.Format(" ( it.OwnerId in {0} )", str2);
            }
            return(str);
        }
Ejemplo n.º 8
0
        //"test_env_FARM"
        public AceLoadBalancer_Anm_v41(LoadBalancerConfig lbConfig)
        {
            var binding = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
            var remoteAddress = new EndpointAddress(lbConfig.Name);

            _proxy = new OperationManagerClient(binding, remoteAddress);
            _username = lbConfig.UserName;
            _password = lbConfig.Password;

            ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
        }
Ejemplo n.º 9
0
        //"test_env_FARM"
        public AceLoadBalancer_Anm_v41(LoadBalancerConfig lbConfig)
        {
            var binding       = new BasicHttpBinding(BasicHttpSecurityMode.Transport);
            var remoteAddress = new EndpointAddress(lbConfig.Name);

            _proxy    = new OperationManagerClient(binding, remoteAddress);
            _username = lbConfig.UserName;
            _password = lbConfig.Password;

            ServicePointManager.ServerCertificateValidationCallback = (sender, certificate, chain, errors) => true;
        }
        public MainWindow(IViewModel <MainWindowViewModel> model, LocLocalizer localizer,
                          IMainWindowCoordinator mainWindowCoordinator, IDialogCoordinator coordinator,
                          ProjectFileWorkspace workspace,
                          CommonUIFramework framework, IOperationManager operationManager)
            : base(model)
        {
            _localizer             = localizer;
            _mainWindowCoordinator = mainWindowCoordinator;
            _coordinator           = coordinator;
            _workspace             = workspace;
            _framework             = framework;

            InitializeComponent();

            var diag = (IDialogCoordinatorUIEvents)_coordinator;

            diag.ShowDialogEvent += o => this.ShowDialog(o);
            diag.HideDialogEvent += () => Dialogs.CurrentSession?.Close();

            _mainWindowCoordinator.TitleChanged +=
                () => Dispatcher.BeginInvoke(new Action(MainWindowCoordinatorOnTitleChanged));
            _mainWindowCoordinator.IsBusyChanged += IsBusyChanged;

            Closing += OnClosing;
            Closed  += async(_, _) =>
            {
                SaveLayout();
                Shutdown?.Invoke(this, EventArgs.Empty);

                await Task.Delay(TimeSpan.FromSeconds(60));

                Process.GetCurrentProcess().Kill(false);
            };

            operationManager.OperationFailed
            .ObserveOnDispatcher()
            .Subscribe(f =>
            {
                Snackbar.MessageQueue ??= new SnackbarMessageQueue(TimeSpan.FromSeconds(5));
                Snackbar.MessageQueue.Enqueue($"{f.Status ?? " / "}");
            });
        }
        public async Task multithreaded_simulation_should_be_cancelled()
        {
            IOperationManager <SessionState, TaskState> operationManager = CreateOperationManager();

            Enumerable
            .Range(1, 20)
            .Select(i => operationManager.CreateOperation(new OperationId(i.ToString()), new TaskState {
                Number = i
            }))
            .ToArray();

            await operationManager.Start(new ExecutionOptions <SessionState, TaskState>()
            {
                Executor            = new MultiplyByTwo(),
                MaxConcurrencyLevel = 4,
                OnOperationFinished = OnOperationFinished,
                OnSessionFinished   = OnSessionFinished
            });

            await Task.Delay(1200);

            operationManager.Stop();

            await operationManager.SessionCompletion;

            var session = operationManager.SessionWithOperations;

            session.Status.Should().Be(OperationStatus.Finished);

            var metrics = session.GetMetrics();

            metrics.OperationsCount.Should().Be(20);
            metrics.FinishedCount.Should().Be(8);
            metrics.SuccessCount.Should().Be(4);
            metrics.ErrorCount.Should().Be(4);
            metrics.InProgressCount.Should().Be(0);
        }
Ejemplo n.º 12
0
 public CheckinService(ISessionBagService sessionBag, IOperationManager client, IOptions <AppSettings> appSettings) : base(appSettings)
 {
     _sessionBag = sessionBag ?? throw new ArgumentNullException(nameof(sessionBag));
     _client     = client ?? throw new ArgumentNullException(nameof(client));
 }
Ejemplo n.º 13
0
        public MainWindowViewModel(ILifetimeScope lifetimeScope, Dispatcher dispatcher, IOperationManager operationManager, LocLocalizer localizer, IDialogCoordinator dialogCoordinator,
                                   AppConfig config, IDialogFactory dialogFactory, IViewModel <CenterViewModel> model, IMainWindowCoordinator mainWindowCoordinator, ProjectFileWorkspace workspace)
            : base(lifetimeScope, dispatcher)
        {
            Receive <IncommingEvent>(e => e.Action());

            var last             = QueryProperty.Create <ProjectFile?>();
            var loadingOperation = QueryProperty.Create <OperationController?>();

            var self = Self;

            CenterView = this.RegisterViewModel(nameof(CenterView), model);
            workspace.Source.ProjectReset.RespondOn(null, pr => last.Value = pr.ProjectFile);

            #region Restarting

            OnPreRestart += (exception, o) =>
            {
                if (last != null)
                {
                    Self.Tell(last);
                }
            };
            Receive <ProjectFile>(workspace.Reset);

            #endregion

            #region Operation Manager

            RunningOperations = RegisterProperty <IEnumerable <RunningOperation> >(nameof(RunningOperations)).WithDefaultValue(operationManager.RunningOperations);
            RenctFiles        = RegisterProperty <RenctFilesCollection>(nameof(RenctFiles)).WithDefaultValue(new RenctFilesCollection(config, s => self.Tell(new InternlRenctFile(s))));

            NewCommad.WithExecute(operationManager.Clear, b => operationManager.ShouldClear(b, AddResource)).ThenRegister("ClearOp");
            NewCommad.WithExecute(operationManager.CompledClear, b => operationManager.ShouldCompledClear(b, AddResource)).ThenRegister("ClearAllOp");

            #endregion

            #region Save As

            UpdateSource?SaveAsProject()
            {
                var targetFile = dialogFactory.ShowSaveFileDialog(null, true, false, true, "transp", true,
                                                                  localizer.OpenFileDialogViewDialogFilter, true, true, localizer.MainWindowMainMenuFileSaveAs, Directory.GetCurrentDirectory(), out var result);

                if (result != true && CheckSourceOk(targetFile))
                {
                    return(null);
                }

                return(new UpdateSource(targetFile !));
            }

            bool CheckSourceOk(string?source)
            {
                if (!string.IsNullOrWhiteSpace(source))
                {
                    return(false);
                }
                UICall(() => dialogCoordinator.ShowMessage(localizer.CommonError, localizer.MainWindowModelLoadProjectSourceEmpty !));
                return(true);
            }

            NewCommad.WithCanExecute(b => b.FromProperty(last, file => file != null && !file.IsEmpty))
            .ThenFlow(SaveAsProject, b => b.Send.ToModel(CenterView))
            .ThenRegister("SaveAs");

            #endregion

            #region Open File

            Receive <InternlRenctFile>(o => OpentFileSource(o.File));

            async Task <LoadedProjectFile?> SourceSelectedFunc(SourceSelected s)
            {
                if (s.Mode != OpenFileMode.OpenExistingFile)
                {
                    return(await NewFileSource(s.Source));
                }
                OpentFileSource(s.Source);
                return(null);
            }

            void OpentFileSource(string?source)
            {
                if (CheckSourceOk(source))
                {
                    return;
                }

                mainWindowCoordinator.IsBusy = true;
                loadingOperation.Value       = operationManager.StartOperation(string.Format(localizer.MainWindowModelLoadProjectOperation, Path.GetFileName(source) ?? source));

                if (!workspace.ProjectFile !.IsEmpty)
                {
                    workspace.ProjectFile.Operator.Tell(ForceSave.Force(workspace.ProjectFile));
                }

                ProjectFile.BeginLoad(Context, loadingOperation.Value.Id, source !, "Project_Operator");
            }

            SupplyNewProjectFile?ProjectLoaded(LoadedProjectFile obj)
            {
                if (loadingOperation !.Value != null)
                {
                    if (obj.Ok)
                    {
                        loadingOperation.Value.Compled();
                    }
                    else
                    {
                        mainWindowCoordinator.IsBusy = false;
                        loadingOperation.Value.Failed(obj.ErrorReason?.Message ?? localizer.CommonError);
                        return(null);
                    }
                }

                loadingOperation.Value = null;
                if (obj.Ok)
                {
                    RenctFiles.Value.AddNewFile(obj.ProjectFile.Source);
                }

                last !.Value = obj.ProjectFile;

                return(new SupplyNewProjectFile(obj.ProjectFile));
            }

            NewCommad.WithCanExecute(b => b.NotNull(loadingOperation))
            .ThenFlow(
                SourceSelected.From(this.ShowDialog <IOpenFileDialog, string?>(TypedParameter.From(OpenFileMode.OpenExistingFile)), OpenFileMode.OpenExistingFile),
                b =>
            {
                b.Func(SourceSelectedFunc).ToSelf()
                .Then(b2 => b2.Func(ProjectLoaded !).ToModel(CenterView));
            })
        /// <inheritdoc />
        public IOperationManager <TSessionState, TOperationState> AddOperationManager(IOperationManager <TSessionState, TOperationState> operationManager)
        {
            if (operationManager.SessionManager != this)
            {
                throw new ArgumentException("OperationManager.SessionManager should be the same as target SessionManager", nameof(operationManager));
            }

            // Add SessionManager metadata to OperationManager
            var mergedMetadata = new MutablePropertyContainer(_metadata);

            mergedMetadata.SetValues(operationManager.Metadata);
            operationManager.UpdateSession(context => context.NewMetadata = mergedMetadata);

            SessionStorage.Set(operationManager.Session.Id.Value, operationManager);

            return(operationManager);
        }
Ejemplo n.º 15
0
 public FileManager(IOperationManager operationManager, ILogger <FileManager> logger, IFileDatabase fileDatabase)
 {
     _operationManager = operationManager;
     _logger           = logger;
     _fileDatabase     = fileDatabase;
 }
Ejemplo n.º 16
0
 public MachinesController(StateStoreContext context, IOperationManager operationManager)
 {
     _db = context;
     _operationManager = operationManager;
 }
 /// <inheritdoc />
 public void Set(string sessionId, IOperationManager <TSessionState, TOperationState> operationManager)
 {
     _sessionsCache.Set(sessionId, operationManager);
 }
Ejemplo n.º 18
0
        public CenterViewModel(ILifetimeScope lifetimeScope, IUIDispatcher dispatcher, IOperationManager manager,
                               LocLocalizer localizer, IDialogCoordinator dialogCoordinator,
                               IMainWindowCoordinator mainWindow, ProjectFileWorkspace workspace)
            : base(lifetimeScope, dispatcher)
        {
            var proxy = Context.ActorOf <ObservableActor>("Loading_Proxy");

            this.Receive <IncommingEvent>(e => e.Action());

            Views          = this.RegisterUiCollection <ProjectViewContainer>(nameof(Views)).BindToList(out var viewList);
            CurrentProject = RegisterProperty <int?>(nameof(CurrentProject));

            AddProject(new Project {
                ProjectName = "Dummy"
            });
Ejemplo n.º 19
0
 public static void AUD_OperationCheck(this IOperationManager opm, IEntitySchema es, object entity, EntityOperationEnum operationEnum)
 {
 }
Ejemplo n.º 20
0
        public MainWindowViewModel(ILifetimeScope lifetimeScope, IUIDispatcher dispatcher,
                                   IOperationManager operationManager, LocLocalizer localizer, IDialogCoordinator dialogCoordinator,
                                   AppConfig config, IDialogFactory dialogFactory, IViewModel <CenterViewModel> model,
                                   IMainWindowCoordinator mainWindowCoordinator, ProjectFileWorkspace workspace)
            : base(lifetimeScope, dispatcher)
        {
            this.Receive <IncommingEvent>(e => e.Action());

            var last             = new RxVar <ProjectFile?>(null);
            var loadingOperation = new RxVar <OperationController?>(null);

            var self = Self;

            CenterView = this.RegisterViewModel(nameof(CenterView), model);
            workspace.Source.ProjectReset.RespondOn(null, pr => last.Value = pr.ProjectFile);

            #region Restarting

            Start.Subscribe(_ =>
            {
                if (last != null)
                {
                    Self.Tell(last);
                }
            });
            this.Receive <ProjectFile>(workspace.Reset);

            #endregion

            #region Operation Manager

            RunningOperations = RegisterProperty <IEnumerable <RunningOperation> >(nameof(RunningOperations))
                                .WithDefaultValue(operationManager.RunningOperations);
            RenctFiles = RegisterProperty <RenctFilesCollection>(nameof(RenctFiles))
                         .WithDefaultValue(new RenctFilesCollection(config, s => self.Tell(new InternlRenctFile(s))));

            NewCommad.WithExecute(operationManager.Clear, operationManager.ShouldClear()).ThenRegister("ClearOp");
            NewCommad.WithExecute(operationManager.CompledClear, operationManager.ShouldCompledClear())
            .ThenRegister("ClearAllOp");

            #endregion

            #region Save As

            IObservable <UpdateSource> SaveAsProject()
            {
                var targetFile = dialogFactory.ShowSaveFileDialog(null, true, false, true, "transp", true,
                                                                  localizer.OpenFileDialogViewDialogFilter, true, true, localizer.MainWindowMainMenuFileSaveAs,
                                                                  Directory.GetCurrentDirectory());

                return(targetFile.NotEmpty()
                       .SelectMany(CheckSourceOk)
                       .Where(d => d.Item1)
                       .Select(r => new UpdateSource(r.Item2)));
            }

            async Task <(bool, string)> CheckSourceOk(string source)
            {
                if (!string.IsNullOrWhiteSpace(source))
                {
                    return(true, source);
                }
                await UICall(()
                             => dialogCoordinator.ShowMessage(localizer.CommonError,
                                                              localizer.MainWindowModelLoadProjectSourceEmpty !));

                return(false, source);
            }

            NewCommad.WithCanExecute(last.Select(pf => pf != null && !pf.IsEmpty))
            .WithFlow(ob => ob.SelectMany(_ => SaveAsProject())
                      .ToModel(CenterView))
            .ThenRegister("SaveAs");

            #endregion

            #region Open File

            IDisposable NewProjectFile(IObservable <SourceSelected> source) => source
            .SelectMany(SourceSelectedFunc)
            .NotNull()
            .ObserveOnSelf()
            .Select(ProjectLoaded)
            .ToModel(CenterView !);


            this.Receive <InternlRenctFile>(o => OpentFileSource(o.File));

            IObservable <LoadedProjectFile?> SourceSelectedFunc(SourceSelected s)
            {
                if (s.Mode != OpenFileMode.OpenExistingFile)
                {
                    return(NewFileSource(s.Source));
                }
                OpentFileSource(s.Source);
                return(Observable.Return <LoadedProjectFile?>(null));
            }

            void OpentFileSource(string?rawSource)
            {
                Observable.Return(rawSource)
                .NotEmpty()
                .SelectMany(CheckSourceOk)
                .Select(p => p.Item2)
                .Do(_ => mainWindowCoordinator.IsBusy = true)
                .SelectMany(source => operationManager
                            .StartOperation(string.Format(localizer.MainWindowModelLoadProjectOperation,
                                                          Path.GetFileName(source)))
                            .Do(op => loadingOperation !.Value = op)
                            .Select(operationController => (operationController, source)))
                .Do(_ =>
                {
                    if (!workspace.ProjectFile.IsEmpty)
                    {
                        workspace.ProjectFile.Operator.Tell(ForceSave.Force(workspace.ProjectFile));
                    }
                })
                .ObserveOnSelf()
                .Subscribe(pair
                           => ProjectFile.BeginLoad(Context, pair.operationController.Id, pair.source,
                                                    "Project_Operator"));
            }

            SupplyNewProjectFile?ProjectLoaded(LoadedProjectFile obj)
            {
                try
                {
                    if (loadingOperation !.Value != null)
                    {
                        if (obj.Ok)
                        {
                            loadingOperation.Value.Compled();
                        }
                        else
                        {
                            loadingOperation.Value.Failed(obj.ErrorReason?.Message ?? localizer.CommonError);
                            return(null);
                        }
                    }

                    loadingOperation.Value = null;
                    if (obj.Ok)
                    {
                        RenctFiles !.Value.AddNewFile(obj.ProjectFile.Source);
                    }

                    last !.Value = obj.ProjectFile;

                    return(new SupplyNewProjectFile(obj.ProjectFile));
                }
                finally
                {
                    mainWindowCoordinator.IsBusy = false;
                }
            }

            NewCommad.WithCanExecute(loadingOperation.Select(oc => oc == null))
            .WithFlow(obs => NewProjectFile(obs.Dialog(this, TypedParameter.From(OpenFileMode.OpenExistingFile))
                                            .Of <IOpenFileDialog, string?>()
                                            .Select(s => SourceSelected.From(s, OpenFileMode.OpenExistingFile))))
            .ThenRegister("OpenFile");

            NewProjectFile(Receive <SourceSelected>()).DisposeWith(this);
            Receive <LoadedProjectFile>(ob => ob.Select(ProjectLoaded).ToModel(CenterView !));

            #endregion

            #region New File

            IObservable <LoadedProjectFile?> NewFileSource(string?source)
            {
                source ??= string.Empty;
                var data = new LoadedProjectFile(string.Empty,
                                                 ProjectFile.NewProjectFile(Context, source, "Project_Operator"), null, true);

                if (File.Exists(source))
                {
                    //TODO NewFile Filog Message
                    var result = UICall(async()
                                        => await dialogCoordinator.ShowMessage(localizer.CommonError !, "", null));

                    return(result.Where(b => b == true).Do(_ => mainWindowCoordinator.IsBusy = true).Select(_ => data));
                }

                mainWindowCoordinator.IsBusy = true;
                return(Observable.Return(data));
            }

            NewCommad.WithCanExecute(loadingOperation.Select(oc => oc == null))
            .WithFlow(obs => obs.Dialog(this, TypedParameter.From(OpenFileMode.OpenNewFile))
                      .Of <IOpenFileDialog, string?>()
                      .Select(s => SourceSelected.From(s, OpenFileMode.OpenNewFile))
                      .ToSelf())
            .ThenRegister("NewFile");

            #endregion

            #region Analyzing

            AnalyzerEntries = this.RegisterUiCollection <AnalyzerEntry>(nameof(AnalyzerEntries))
                              .BindToList(out var analyterList);

            var builder = new AnalyzerEntryBuilder(localizer);

            void IssuesChanged(IssuesEvent obj)
            {
                analyterList.Edit(l =>
                {
                    var(ruleName, issues) = obj;
                    l.Remove(AnalyzerEntries.Where(e => e.RuleName == ruleName));
                    l.AddRange(issues.Select(builder.Get));
                });
            }

            this.RespondOnEventSource(workspace.Analyzer.Issues, IssuesChanged);

            #endregion

            #region Build

            var buildModel = lifetimeScope.Resolve <IViewModel <BuildViewModel> >();
            buildModel.InitModel(Context, "Build-View");

            BuildModel = RegisterProperty <IViewModel <BuildViewModel> >(nameof(BuildModel)).WithDefaultValue(buildModel);

            #endregion
        }