public void AddReferencedComponent(IXmlDependencyViewModel dependency) { if (!_dependencies.Contains(dependency)) { _dependencies.Add(dependency); } }
public void RemoveReferencedComponent(IXmlDependencyViewModel dependency) { if (_dependencies.Contains(dependency)) { _dependencies.Remove(dependency); } }
/// <summary> /// Initializes a new instance of the <see cref="FileShareDefinitionEditorViewModel"/> class. /// </summary> /// <param name="type">The resolver type for BinaryRepository.</param> /// <param name="xmlDependencyViewModel">The Xml dependency view model.</param> /// <param name="validDependencyDefinitonFilenameList">The list of valid dependency definition file names.</param> internal FileShareDefinitionEditorViewModel(FileShareResolverType type, IXmlDependencyViewModel xmlDependencyViewModel, string validDependencyDefinitonFilenameList) { if (type == null) { throw new ArgumentNullException("type"); } if (xmlDependencyViewModel == null) { throw new ArgumentNullException("xmlDependencyViewModel"); } if (xmlDependencyViewModel.XmlDependency == null) { throw new ArgumentException( "The argument xmlDependencyViewModel does not contain an IXmlDependency object.", "xmlDependencyViewModel"); } if (string.IsNullOrWhiteSpace(validDependencyDefinitonFilenameList)) { throw new ArgumentNullException("validDependencyDefinitonFilenameList"); } _resolverType = type; _xmlDependencyViewModel = xmlDependencyViewModel; _xmlDependency = xmlDependencyViewModel.XmlDependency; _validDependencyDefinitonFilenameList = validDependencyDefinitonFilenameList; _validationErrors = new Dictionary <string, string>(); ValidateAll(); }
/// <summary> /// Initializes a new instance of the <see cref="SourceControlDefinitionEditorViewModel" /> class. /// </summary> /// <param name="accessService">The TFS access service.</param> /// <param name="type">The resolver type.</param> /// <param name="xmlDependencyViewModel">The XML dependency view model.</param> /// <param name="validDependencyDefinitonFilenameList">The list with valid dependency definition filenames.</param> /// <param name="tpcUrl">The team project collection url.</param> internal SourceControlDefinitionEditorViewModel(ITfsAccessService accessService, IDependencyResolverType type, IXmlDependencyViewModel xmlDependencyViewModel, string validDependencyDefinitonFilenameList, string tpcUrl) { if (null == accessService) { throw new ArgumentNullException("accessService"); } if (type == null) { throw new ArgumentNullException("type"); } if (xmlDependencyViewModel == null) { throw new ArgumentNullException("xmlDependencyViewModel"); } if (xmlDependencyViewModel.XmlDependency == null) { throw new ArgumentException( "The argument xmlDependencyViewModel does not contain an IXmlDependency object.", "xmlDependencyViewModel"); } if (string.IsNullOrWhiteSpace(validDependencyDefinitonFilenameList)) { throw new ArgumentNullException("validDependencyDefinitonFilenameList"); } if (string.IsNullOrWhiteSpace(tpcUrl)) { throw new ArgumentNullException("tpcUrl"); } _tpcUrl = tpcUrl; _accessService = accessService; _accessService.Connect(new Uri(_tpcUrl)); _xmlDependencyViewModel = xmlDependencyViewModel; _xmlDependency = xmlDependencyViewModel.XmlDependency; _validDependencyDefinitonFilenameList = validDependencyDefinitonFilenameList; _validationErrors = new Dictionary <string, string>(); _versionSpecToDisplayStringDictionary = new Dictionary <string, string> { { "T", "Latest version" }, { "C", "Changeset" }, { "D", "Date" }, { "L", "Label" }, { "W", "Workspace Version" } }; _displayStringToVersionSpecDictionary = new Dictionary <string, string>(); foreach (var e in _versionSpecToDisplayStringDictionary) { _displayStringToVersionSpecDictionary.Add(e.Value, e.Key); } LoadAvailableVersionSpecs(); ValidateAll(); }
/// <summary> /// Initializes a new instance of the <see cref="BinaryRepositoryDefinitionEditorViewModel"/> class. /// </summary> /// <param name="accessService">The helper service used to get team foundation server specific information.</param> /// <param name="type">The resolver type for BinaryRepository.</param> /// <param name="xmlDependencyViewModel">The Xml dependency view model.</param> /// <param name="validDependencyDefinitonFilenameList">The list of valid dependency definition file names.</param> /// <param name="filter">The filter to use to filter the available components.</param> /// <param name="tpcUrl">The team project collection url.</param> internal BinaryRepositoryDefinitionEditorViewModel(ITfsAccessService accessService, BinaryRepositoryResolverType type, IXmlDependencyViewModel xmlDependencyViewModel, string validDependencyDefinitonFilenameList, IComponentFilter filter, string tpcUrl) { if (null == accessService) { throw new ArgumentNullException("accessService"); } if (type == null) { throw new ArgumentNullException("type"); } if (xmlDependencyViewModel == null) { throw new ArgumentNullException("xmlDependencyViewModel"); } if (xmlDependencyViewModel.XmlDependency == null) { throw new ArgumentException( "The argument xmlDependencyViewModel does not contain an IXmlDependency object.", "xmlDependencyViewModel"); } if (string.IsNullOrWhiteSpace(validDependencyDefinitonFilenameList)) { throw new ArgumentNullException("validDependencyDefinitonFilenameList"); } if (string.IsNullOrWhiteSpace(tpcUrl)) { throw new ArgumentNullException("tpcUrl"); } _accessService = accessService; _resolverType = type; _xmlDependencyViewModel = xmlDependencyViewModel; _xmlDependency = xmlDependencyViewModel.XmlDependency; _validDependencyDefinitonFilenameList = validDependencyDefinitonFilenameList; _filter = filter; _validationErrors = new Dictionary <string, string>(); if (string.IsNullOrEmpty(SelectedBinaryTeamProjectCollection)) { SelectedBinaryTeamProjectCollection = tpcUrl; } ValidateAll(); // TODO: Use setting to determine whether outputpath should be set automatically PropertyChanged += BinaryRepositoryDefinitionEditorViewModel_PropertyChanged; }
private void PublishSelectedXmlDependencyChangedEvent(IXmlDependencyViewModel oldValue, IXmlDependencyViewModel newValue) { // publish distributed event if (EventPublisher != null) { // may evaluate to null for CreateXmlDependencyViewModel types (desired) var oldXmlDependencyViewModel = oldValue as XmlDependencyViewModel; var newXmlDependencyViewModel = newValue as XmlDependencyViewModel; var theEvent = new SelectedXmlDependencyChangedEvent(oldXmlDependencyViewModel, newXmlDependencyViewModel); EventPublisher.Publish(theEvent); } }
/// <summary> /// Initializes a new instance of the <see cref="BuildResultDefinitionEditorViewModel"/> class. /// </summary> /// <param name="buildService">The helper service used to get team foundation server specific information.</param> /// <param name="type">The resolver type for BuildResult.</param> /// <param name="xmlDependencyViewModel">The Xml dependency view model.</param> /// <param name="validDependencyDefinitonFilenameList">The list of valid dependency definition file names.</param> internal BuildResultDefinitionEditorViewModel(TfsBuildHelper buildService, BuildResultResolverType type, IXmlDependencyViewModel xmlDependencyViewModel, string validDependencyDefinitonFilenameList) { if (null == buildService) { throw new ArgumentNullException("buildService"); } if (type == null) { throw new ArgumentNullException("type"); } if (xmlDependencyViewModel == null) { throw new ArgumentNullException("xmlDependencyViewModel"); } if (xmlDependencyViewModel.XmlDependency == null) { throw new ArgumentException( "The argument xmlDependencyViewModel does not contain an IXmlDependency object.", "xmlDependencyViewModel"); } if (string.IsNullOrWhiteSpace(validDependencyDefinitonFilenameList)) { throw new ArgumentNullException("validDependencyDefinitonFilenameList"); } _buildService = buildService; _xmlDependencyViewModel = xmlDependencyViewModel; _xmlDependency = xmlDependencyViewModel.XmlDependency; _validationErrors = new Dictionary <string, string>(); _importedBuildStatus = _buildService.GetBuildStatus(); if (!string.IsNullOrEmpty(SelectedBuildNumber)) { _filterByStatusAndQuality = false; } else { _filterByStatusAndQuality = true; } OnPropertyChanged("IsCheckedFilterByBuildNumber"); OnPropertyChanged("IsCheckedFilterByStatusAndQuality"); ValidateAll(); }
/// <summary> /// Determines whether the specified dependency matches. /// </summary> /// <param name="dependency">The dependency.</param> /// <param name="teamProject">The team project.</param> /// <param name="componentName">The name of the component.</param> /// <param name="dependencyType">The type of the dependency.</param> /// <returns> /// <c>true</c> if the specified dependency is match; otherwise, <c>false</c>. /// </returns> private static bool IsMatch(IXmlDependencyViewModel dependency, string teamProject, string componentName, string dependencyType) { var otherTeamProject = dependency.XmlDependency.ProviderConfiguration.Settings.GetSettingValue(DependencyProviderValidSettingName.BinaryRepositoryTeamProject); if (!string.IsNullOrEmpty(otherTeamProject)) { return(dependency.ReferencedComponentName == componentName && dependency.Type == dependencyType && otherTeamProject == teamProject); } return(false); }
/// <summary> /// Initializes a new instance of the <see cref="SourceControlDefinitionEditorViewModel" /> class. /// </summary> /// <param name="type">The resolver type.</param> /// <param name="xmlDependencyViewModel">The XML dependency view model.</param> /// <param name="validDependencyDefinitonFilenameList">The list with valid dependency definition filenames.</param> /// <param name="svnUrl">The team project collection url.</param> internal SubversionDefinitionEditorViewModel(IDependencyResolverType type, IXmlDependencyViewModel xmlDependencyViewModel, string validDependencyDefinitonFilenameList, string svnUrl) { if (type == null) { throw new ArgumentNullException("type"); } if (xmlDependencyViewModel == null) { throw new ArgumentNullException("xmlDependencyViewModel"); } if (xmlDependencyViewModel.XmlDependency == null) { throw new ArgumentException( "The argument xmlDependencyViewModel does not contain an IXmlDependency object.", "xmlDependencyViewModel"); } if (string.IsNullOrWhiteSpace(validDependencyDefinitonFilenameList)) { throw new ArgumentNullException("validDependencyDefinitonFilenameList"); } if (string.IsNullOrWhiteSpace(svnUrl)) { throw new ArgumentNullException("svnUrl"); } _svnUrl = svnUrl; _xmlDependencyViewModel = xmlDependencyViewModel; _xmlDependency = xmlDependencyViewModel.XmlDependency; _validDependencyDefinitonFilenameList = validDependencyDefinitonFilenameList; _validationErrors = new Dictionary <string, string>(); _versionSpecToDisplayStringDictionary = new Dictionary <string, string> { { "H", "Head revision" }, { "R", "Revision" } }; _displayStringToVersionSpecDictionary = new Dictionary <string, string>(); foreach (var e in _versionSpecToDisplayStringDictionary) { _displayStringToVersionSpecDictionary.Add(e.Value, e.Key); } LoadAvailableVersionSpecs(); ValidateAll(); }
private IValidatingViewModel GetDefinitionEditorViewModel(IXmlDependencyViewModel xmlDependencyViewModel, string dependencyDefinitionFileList, string tpcUrl) { return(new VNextBuildResultDefinitionEditorViewModel(new TfsBuild2Helper(new Uri(tpcUrl)), this, xmlDependencyViewModel, dependencyDefinitionFileList)); }
public FrameworkElement GetDefinitionEditor(IDependencyInjectionService dependencyInjectionService, IXmlDependencyViewModel xmlDependencyViewModel, string dependencyDefinitionFileList, string tpcUrl) { var view = new VNextBuildResultDefinitionEditor(); view.DataContext = GetDefinitionEditorViewModel(xmlDependencyViewModel, dependencyDefinitionFileList, tpcUrl); return(view); }
/// <summary> /// Gets the definition editor view model. /// </summary> /// <param name="xmlDependencyViewModel">The XML dependency view model.</param> /// <param name="dependencyDefinitionFileList">The list of valid dependency definition file names.</param> /// <param name="tpcUrl">The team project collection url.</param> /// <returns>Returns the definition editor view model</returns> private IValidatingViewModel GetDefinitionEditorViewModel(IXmlDependencyViewModel xmlDependencyViewModel, string dependencyDefinitionFileList, string tpcUrl) { return(new SourceControlDefinitionEditorViewModel(new TfsAccessService(), this, xmlDependencyViewModel, dependencyDefinitionFileList, tpcUrl)); }
/// <summary> /// Gets the definition editor. /// </summary> /// <param name="dependencyInjectionService">The dependency injection service.</param> /// <param name="xmlDependencyViewModel">The XML dependency view model.</param> /// <param name="dependencyDefinitionFileList">The list with valid dependency definition file names.</param> /// <param name="tpcUrl">The team project collection url.</param> /// <returns>Returns the definition editor</returns> public FrameworkElement GetDefinitionEditor(IDependencyInjectionService dependencyInjectionService, IXmlDependencyViewModel xmlDependencyViewModel, string dependencyDefinitionFileList, string tpcUrl) { var view = new SourceControlMappingDefinitionEditor { DataContext = GetDefinitionEditorViewModel(xmlDependencyViewModel, dependencyDefinitionFileList, tpcUrl) }; return(view); }
/// <summary> /// Gets the definition editor view model. /// </summary> /// <param name="dependencyInjectionService">The dependency injection service.</param> /// <param name="xmlDependencyViewModel">The XML dependency view model.</param> /// <param name="dependencyDefinitionFileList">The list with valid dependency definition filenames.</param> /// <param name="tpcUrl">The binary team project collection url.</param> /// <returns>The BinaryRepository dependency editor view model.</returns> private IValidatingViewModel GetDefinitionEditorViewModel(IDependencyInjectionService dependencyInjectionService, IXmlDependencyViewModel xmlDependencyViewModel, string dependencyDefinitionFileList, string tpcUrl) { var referencedComponentsTrackingService = dependencyInjectionService.GetDependency <IReferencedComponentsTrackingService>(); var filter = new UsedComponentsFilter(referencedComponentsTrackingService); return(new BinaryRepositoryDefinitionEditorViewModel(new TfsAccessService(), this, xmlDependencyViewModel, dependencyDefinitionFileList, filter, tpcUrl)); }
/// <summary> /// Gets the definition editor view model. /// </summary> /// <param name="xmlDependencyViewModel">The XML dependency view model.</param> /// <param name="dependencyDefinitionFileList">The list with valid dependency definition file names.</param> /// <param name="svnUrl">The team project collection url.</param> /// <returns>Returns the definition editor view model</returns> private IValidatingViewModel GetDefinitionEditorViewModel(IXmlDependencyViewModel xmlDependencyViewModel, string dependencyDefinitionFileList, string svnUrl) { return(new SubversionDefinitionEditorViewModel(this, xmlDependencyViewModel, dependencyDefinitionFileList, svnUrl)); }
/// <summary> /// Gets the definition editor. /// </summary> /// <param name="dependencyInjectionService">The dependency injection service.</param> /// <param name="xmlDependencyViewModel">The XML dependency view model.</param> /// <param name="dependencyDefinitionFileList">The list with valid the dependency definition file names.</param> /// <param name="svnUrl">The team project collection url.</param> /// <returns>Returns the definition editor</returns> public FrameworkElement GetDefinitionEditor(IDependencyInjectionService dependencyInjectionService, IXmlDependencyViewModel xmlDependencyViewModel, string dependencyDefinitionFileList, string svnUrl) { var view = new SubversionDefinitionEditor { DataContext = GetDefinitionEditorViewModel(xmlDependencyViewModel, dependencyDefinitionFileList, svnUrl) }; return(view); }
/// <summary> /// Gets the file share definition editor view model. /// </summary> /// <param name="xmlDependencyViewModel">The XML dependency view model.</param> /// <param name="dependencyDefinitionFileList">The dependency definition file list.</param> /// <returns>The file share definition editor view model</returns> private IValidatingViewModel GetDefinitionEditorViewModel(IXmlDependencyViewModel xmlDependencyViewModel, string dependencyDefinitionFileList) { return(new FileShareDefinitionEditorViewModel(this, xmlDependencyViewModel, dependencyDefinitionFileList)); }