Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the FileInputMechanism class.
        /// </summary>
        /// <param name="baseDirectoryPath"> The base input directory path. </param>
        /// <param name="xpe"> The XML persist engine in-effect. </param>
        /// <param name="sourceStrategy"> The source strategy in-effect. </param>
        public FileInputMechanism(string baseDirectoryPath, IXmlPersistEngine xpe, ISourceStrategy sourceStrategy)
        {
            if ((object)baseDirectoryPath == null)
            {
                throw new ArgumentNullException(nameof(baseDirectoryPath));
            }

            if ((object)xpe == null)
            {
                throw new ArgumentNullException(nameof(xpe));
            }

            if ((object)sourceStrategy == null)
            {
                throw new ArgumentNullException(nameof(sourceStrategy));
            }

            if (!Path.HasExtension(baseDirectoryPath) &&
                !baseDirectoryPath.EndsWith(Path.DirectorySeparatorChar.ToString()))
            {
                baseDirectoryPath = baseDirectoryPath + Path.DirectorySeparatorChar;
            }

            this.baseDirectoryPath = Path.GetDirectoryName(Path.GetFullPath(baseDirectoryPath));
            this.xpe            = xpe;
            this.sourceStrategy = sourceStrategy;
        }
Exemple #2
0
		/// <summary>
		/// Initializes a new instance of the FileInputMechanism class.
		/// </summary>
		/// <param name="baseDirectoryPath"> The base input directory path. </param>
		/// <param name="xpe"> The XML persist engine in-effect. </param>
		/// <param name="sourceStrategy"> The source strategy in-effect. </param>
		public FileInputMechanism(string baseDirectoryPath, IXmlPersistEngine xpe, ISourceStrategy sourceStrategy)
		{
			if ((object)baseDirectoryPath == null)
				throw new ArgumentNullException(nameof(baseDirectoryPath));

			if ((object)xpe == null)
				throw new ArgumentNullException(nameof(xpe));

			if ((object)sourceStrategy == null)
				throw new ArgumentNullException(nameof(sourceStrategy));

			if (!Path.HasExtension(baseDirectoryPath) &&
				!baseDirectoryPath.EndsWith(Path.DirectorySeparatorChar.ToString()))
				baseDirectoryPath = baseDirectoryPath + Path.DirectorySeparatorChar;

			this.baseDirectoryPath = Path.GetDirectoryName(Path.GetFullPath(baseDirectoryPath));
			this.xpe = xpe;
			this.sourceStrategy = sourceStrategy;
		}