private async void UpdateAvailableWorkspaces()
        {
            IEnumerable <Workspace> workspacesWithSettings = await Task.Run(() => tfsContext.GetWorkspaces().Where(w => w != TargetWorkspace && settingsService.HasSettings(tfsContext.SelectedProfile, w)));

            AvailableWorkspaces.Clear();
            AvailableWorkspaces.AddRange(workspacesWithSettings.Distinct().ToList());
            CopyCommand.RaiseCanExecuteChanged();
        }
Ejemplo n.º 2
0
        public async Task CreateWorkspace(TState state, bool loadLayout)
        {
            var candidate = AvailableWorkspaces.FirstOrDefault(wspace => wspace.State.Equals(state));

            //we infer !loadLayout == create blank workspace
            if (null != candidate && loadLayout)
            {
                CurrentWorkspace = candidate;
                return;
            }

            var arg = new ExplicitArguments();

            arg.SetArg("loadLayout", loadLayout);

            var workspace = AppContainer.ObjectProvider.GetInstance <IWorkspace <TState> >(arg);

            await workspace.Initialize(state);

            AvailableWorkspaces.Add(workspace);
        }