コード例 #1
0
        public BuildManagerViewModel(Window owner, ITfsClientRepository repository, IMainView view, IEnumerable <IBuildController> controllers, IEnumerable <TeamProject> teamProjects, ITfsContext context)
        {
            this.owner                             = owner;
            this.repository                        = repository;
            this.view                              = view;
            this.context                           = context;
            this.BuildDefinitions                  = new ObservableCollection <BuildDefinitionViewModel>();
            this.Builds                            = new ObservableCollection <BuildViewModel>();
            this.DeleteCommand                     = new DelegateCommand(this.OnDelete);
            this.OpenDropFolderCommand             = new DelegateCommand(this.OnOpenDropfolder);
            this.RetainIndefinitelyCommand         = new DelegateCommand(this.OnRetainIndefinitely);
            this.SetBuildQualityCommand            = new DelegateCommand(this.OnSetBuildQuality);
            this.BuildNotesCommand                 = new DelegateCommand(this.OnBuildNotes);
            this.DeleteBuildCommand                = new DelegateCommand(this.OnDeleteBuild);
            this.ShowDetailsCommand                = new DelegateCommand(this.OnShowDetails);
            this.ShowQueuedDetailsCommand          = new DelegateCommand(this.OnShowQueuedDetails);
            this.StopBuildCommand                  = new DelegateCommand(this.OnStopBuild);
            this.ChangeBuildTemplateCommand        = new DelegateCommand(this.OnChangeBuildTemplate);
            this.SetDefaultBuildTemplateCommand    = new DelegateCommand(this.OnSetDefaultBuildTemplate, this.OnCanSetDefaultBuildTemplate);
            this.AddBuildProcessTemplateCommand    = new DelegateCommand(this.OnAddBuildProcessTemplate);
            this.RemoveBuildProcessTemplateCommand = new DelegateCommand(this.OnRemoveBuildProcessTemplate);
            this.EnableCommand                     = new DelegateCommand(this.OnEnable, this.OnCanEnable);
            this.DisableCommand                    = new DelegateCommand(this.OnDisable, this.OnCanDisable);
            this.SetRetentionPoliciesCommand       = new DelegateCommand(this.OnSetRetentionsPolicies);
            this.ChangeBuildControllerCommand      = new DelegateCommand(this.OnChangeBuildController);
            this.ChangeDefaultDropLocationCommand  = new DelegateCommand(this.OnChangeDefaultDropLocation);
            this.ChangeTriggerCommand              = new DelegateCommand(this.OnChangeTrigger);

            this.CloneBuildsCommand            = new DelegateCommand(this.OnCloneBuilds, this.OnCanCloneBuilds);
            this.QueueBuildsCommand            = new DelegateCommand(this.OnQueueBuilds, this.OnCanQueueBuilds);
            this.EditBuildDefinitionCommand    = new DelegateCommand(this.OnEditBuildDefinition, this.OnCanEditBuildDefinition);
            this.GenerateBuildResourcesCommand = new DelegateCommand(this.OnGenerateBuildResources);
            this.Controllers        = new ObservableCollection <string>(controllers.Select(c => c.Name));
            this.RefreshCurrentView = new DelegateCommand(this.OnRefreshCurrentView);
            this.Controllers.Insert(0, AllItem);
            this.TeamProjects = new ObservableCollection <string>(teamProjects.Select(tp => tp.Name));
            this.TeamProjects.Insert(0, AllItem);
            this.SelectedBuildFilter             = BuildFilter.Queued;
            this.includeDisabledBuildDefinitions = false;
            this.BuildViews = new ObservableCollection <BuildViewItem> {
                new BuildViewItem {
                    Name = "Build Definitions", Value = BuildView.BuildDefinitions
                }, new BuildViewItem {
                    Name = "Builds", Value = BuildView.Builds
                }, new BuildViewItem {
                    Name = "Build Process Templates", Value = BuildView.BuildProcessTemplates
                }
            };
            this.DateFilters             = new DateFilterCollection();
            this.SelectedBuildView       = BuildView.BuildDefinitions;
            this.selectedBuildDateFilter = DateFilter.Today;
            this.BuildProcessTemplatess  = new ObservableCollection <BuildTemplateViewModel>();
        }
コード例 #2
0
        public void Initialize()
        {
            shimContext = ShimsContext.Create();

            projectShim = new ShimProject();

            projectShim.NameGet = () => "TestProject";

            ShimQueryItem.AllInstances.ProjectGet = q => projectShim;

            var tfsContextInstance = new FakeTfsContext(shimContext);

            tfsContextMock = A.Fake<ITfsContext>(o => o.Wrapping(tfsContextInstance));
        }
コード例 #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TfsProjects"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="projectName">Name of the project.</param>
        public TfsProjects(ITfsContext context)
        {
            NetworkCredential netCred = new NetworkCredential(context.Username, context.Password);

            BasicAuthCredential basicCred = new BasicAuthCredential(netCred);
            TfsClientCredentials tfsCred = new TfsClientCredentials(basicCred);
            tfsCred.AllowInteractive = false;

            ProjectCollection = new TfsTeamProjectCollection(new Uri(context.Uri), tfsCred);
            ProjectCollection.Authenticate();

            Store = new WorkItemStore(ProjectCollection);
            ProjectName = context.ProjectName;
        }
コード例 #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="TfsProjects"/> class.
        /// </summary>
        /// <param name="context">The context.</param>
        /// <param name="projectName">Name of the project.</param>
        public TfsProjects(ITfsContext context)
        {
            NetworkCredential netCred = new NetworkCredential(context.Username, context.Password);

            BasicAuthCredential  basicCred = new BasicAuthCredential(netCred);
            TfsClientCredentials tfsCred   = new TfsClientCredentials(basicCred);

            tfsCred.AllowInteractive = false;

            ProjectCollection = new TfsTeamProjectCollection(new Uri(context.Uri), tfsCred);
            ProjectCollection.Authenticate();

            Store       = new WorkItemStore(ProjectCollection);
            ProjectName = context.ProjectName;
        }
コード例 #5
0
 public BuildManagerViewModel(Window owner, ITfsClientRepository repository, IMainView view, IEnumerable<IBuildController> controllers, IEnumerable<string> teamProjects, ITfsContext context)
 {
     this.owner = owner;
     this.repository = repository;
     this.view = view;
     this.context = context;
     this.BuildDefinitions = new ObservableCollection<BuildDefinitionViewModel>();
     this.Builds = new ObservableCollection<BuildViewModel>();
     this.BuildResources = new ObservableCollection<BuildResourceViewModel>();
     this.CleanDropsCommands = new DelegateCommand(this.OnCleanDrops);
     this.DeleteCommand = new DelegateCommand(this.OnDelete);
     this.OpenDropFolderCommand = new DelegateCommand(this.OnOpenDropfolder);
     this.RetainIndefinitelyCommand = new DelegateCommand(this.OnRetainIndefinitely);
     this.SetBuildQualityCommand = new DelegateCommand(this.OnSetBuildQuality);
     this.BuildNotesCommand = new DelegateCommand(this.OnBuildNotes);
     this.DeleteBuildCommand = new DelegateCommand(this.OnDeleteBuild);
     this.ShowDetailsCommand = new DelegateCommand(this.OnShowDetails);
     this.RetryCommand = new DelegateCommand(this.OnRetry);
     this.ViewBuildLogsCommand = new DelegateCommand(this.OnViewBuildLogs);
     this.ShowQueuedDetailsCommand = new DelegateCommand(this.OnShowQueuedDetails);
     this.StopBuildCommand = new DelegateCommand(this.OnStopBuild);
     this.DisabledQueuedDefinitionCommand = new DelegateCommand(this.OnDisabledQueuedDefinition);
     this.PauseQueuedDefinitionCommand = new DelegateCommand(this.OnPauseQueuedDefinition);
     this.ResumeBuildCommand = new DelegateCommand(this.OnResumeBuild);
     this.ChangeBuildTemplateCommand = new DelegateCommand(this.OnChangeBuildTemplate);
     this.SetDefaultBuildTemplateCommand = new DelegateCommand(this.OnSetDefaultBuildTemplate, this.OnCanSetDefaultBuildTemplate);
     this.AddBuildProcessTemplateCommand = new DelegateCommand(this.OnAddBuildProcessTemplate);
     this.RemoveBuildProcessTemplateCommand = new DelegateCommand(this.OnRemoveBuildProcessTemplate);
     this.EditControllerCommand = new DelegateCommand(this.OnEditController);
     this.EnableBuildResourceCommand = new DelegateCommand(this.OnEnableBuildResource);
     this.DisableBuildResourceCommand = new DelegateCommand(this.OnDisableBuildResource);
     this.RemoveCommand = new DelegateCommand(this.OnRemove);
     this.EnableCommand = new DelegateCommand(this.OnEnable);
     this.DisableCommand = new DelegateCommand(this.OnDisable);
     this.PauseCommand = new DelegateCommand(this.OnPause);
     this.SetRetentionPoliciesCommand = new DelegateCommand(this.OnSetRetentionsPolicies);
     this.ChangeBuildControllerCommand = new DelegateCommand(this.OnChangeBuildController);
     this.ChangeDefaultDropLocationCommand = new DelegateCommand(this.OnChangeDefaultDropLocation);
     this.ChangeOutputLocationAsConfiguredCommand = new DelegateCommand(this.OnChangeOutputLocationAsConfiguredCommand);
     this.ChangeOutputLocationPerProjectCommand = new DelegateCommand(this.OnChangeOutputLocationPerProjectCommand);
     this.ChangeOutputLocationSingleFolderCommand = new DelegateCommand(this.OnChangeOutputLocationSingleFolderCommand);
     this.ChangeTriggerCommand = new DelegateCommand(this.OnChangeTrigger);
     this.ExportDefinitionCommand = new DelegateCommand(this.OnExportBuildDefinition);
     this.CloneBuildsCommand = new DelegateCommand(this.OnCloneBuilds, this.OnCanCloneBuilds);
     this.CloneGitBuildsCommand = new DelegateCommand(this.OnCloneGitBuilds, this.OnCanCloneBuilds);
     this.CloneBuildToProjectCommand = new DelegateCommand(this.OnCloneBuildToProject, this.OnCanCloneBuilds);
     this.RemapWorkspacesCommand = new DelegateCommand(this.OnRemapWorkspaces, this.OnCanRemapWorkspaces);
     this.QueueBuildsCommand = new DelegateCommand(this.OnQueueBuilds, this.OnCanQueueBuilds);
     this.QueueHighBuildsCommand = new DelegateCommand(this.OnQueueHighBuilds, this.OnCanQueueBuilds);
     this.EditBuildDefinitionCommand = new DelegateCommand(this.OnEditBuildDefinition, this.OnCanEditBuildDefinition);
     this.GenerateBuildResourcesCommand = new DelegateCommand(this.OnGenerateBuildResources);
     this.Controllers = new ObservableCollection<string>(controllers.Select(c => c.Name));
     this.Controllers.Sort();
     this.RefreshCurrentView = new DelegateCommand(this.OnRefreshCurrentView);
     this.ImportBuildDefinition = new DelegateCommand(this.OnImportBuildDefinition);
     this.Controllers.Insert(0, AllItem);
     this.TeamProjects = new ObservableCollection<string>(teamProjects.Select(tp => tp));
     this.TeamProjects.Sort();
     this.TeamProjects.Insert(0, AllItem);
     this.SelectedBuildFilter = BuildFilter.Queued;
     this.includeDisabledBuildDefinitions = false;
     this.BuildViews = new ObservableCollection<BuildViewItem> { new BuildViewItem { Name = "Build Definitions", Value = BuildView.BuildDefinitions }, new BuildViewItem { Name = "Builds", Value = BuildView.Builds }, new BuildViewItem { Name = "Build Process Templates", Value = BuildView.BuildProcessTemplates }, new BuildViewItem { Name = "Build Resources", Value = BuildView.BuildResources } };
     this.DateFilters = new DateFilterCollection();
     this.SelectedBuildView = BuildView.BuildDefinitions;
     this.selectedBuildDateFilter = DateFilter.Today;
     this.BuildProcessTemplatess = new ObservableCollection<BuildTemplateViewModel>();
 }
コード例 #6
0
 public void InitializeExtension(TeamFoundationServerExt ext, IVsTeamFoundationBuild buildExt)
 {
     this.ctx = new VSExtensionContext(ext, buildExt);
     this.ctx.ProjectChanged += this.OnProjectChanged;
     this.ChangeConnection();
 }
コード例 #7
0
 public void InitializeContext(ITfsContext tfsContext)
 {
     this.initialized             = false;
     this.context                 = tfsContext;
     this.context.ProjectChanged += this.OnProjectChanged;
 }
コード例 #8
0
 public MeMacro(ITfsContext tfsContext)
     : base("Me")
 {
     this.tfsContext = tfsContext;
 }
コード例 #9
0
 /// <summary>Initializes a new instance of the <see cref="T:System.Object" /> class.</summary>
 public CPSpecificActions()
 {
     tfsContext = CPPlugin.Get <ITfsContext>();
 }
コード例 #10
0
 public void InitializeExtension(TeamFoundationServerExt ext, IVsTeamFoundationBuild buildExt)
 {
     this.ctx = new VSExtensionContext(ext, buildExt);
     this.ctx.ProjectChanged += this.OnProjectChanged;
     this.ChangeConnection();
 }
コード例 #11
0
 public QueryFinder(ITfsContext tfsContext)
 {
     this.tfsContext = tfsContext;
 }
コード例 #12
0
 public ProjectMacro(ITfsContext tfsContext)
     : base("Project")
 {
     this.tfsContext = tfsContext;
 }
コード例 #13
0
ファイル: MainView.xaml.cs プロジェクト: nagyist/BuildManager
 public void InitializeContext(ITfsContext tfsContext)
 {
     this.initialized = false;
     this.context = tfsContext;
     this.context.ProjectChanged += this.OnProjectChanged;
 }
コード例 #14
0
 public QueryRunner(ITfsContext currentContext, IQueryMacroParser macroParser)
 {
     this.currentContext = currentContext;
     this.macroParser = macroParser;
 }