/// <summary>
        /// Registers a new <see cref="IDependencyResolverType"/> in the <see cref="IDependencyService"/>
        /// </summary>
        /// <param name="resolverType">The dependency resolver type that shall be registered</param>
        public void RegisterResolverType(IDependencyResolverType resolverType)
        {
            if (null == resolverType)
            {
                throw new ArgumentNullException("resolverType");
            }

            DependencyResolverFactory.RegisterResolverType(resolverType);
        }
        public IXmlDependency CreateEmptyIXmlDependency(IDependencyResolverType resolverType)
        {
            if (resolverType == null)
            {
                throw new ArgumentNullException("resolverType");
            }

            var parser  = new ParserXml();
            var iXmlDep = parser.CreateEmptyIXmlDependency(resolverType.DependencyType);

            return(iXmlDep);
        }
Beispiel #3
0
        /// <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();
        }
Beispiel #4
0
        /// <summary>
        /// Registers a new <see cref="IDependencyResolverType"/> in the factory
        /// </summary>
        /// <param name="resolverType">An actual instance of the <see cref="IDependencyResolverType"/></param>
        internal static void RegisterResolverType(IDependencyResolverType resolverType)
        {
            if (null == resolverType)
            {
                return;
            }

            if (Types.ContainsKey(resolverType.ReferenceName))
            {
                Types[resolverType.ReferenceName] = resolverType;
            }
            else
            {
                Types.Add(resolverType.ReferenceName, resolverType);
                Logger.Instance().Log(TraceLevel.Info, "New resolver type {0} registered", resolverType);
            }
        }
 public XmlDependencyCreationEventArgs(IDependencyResolverType resolverType)
 {
     this.ResolverType = resolverType;
 }
Beispiel #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ResolverTypeViewModel"/> class.
 /// </summary>
 /// <param name="resolverType">The registered resolver type</param>
 internal ResolverTypeViewModel(IDependencyResolverType resolverType)
 {
     _resolverType = resolverType;
 }
        /// <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();
        }