Пример #1
0
        /// <summary>
        /// Creates a project shim from a project file.
        /// </summary>
        /// <param name="file">The path to the project file.</param>
        /// <returns>The project shim</returns>
        private static ProjectShim CreateProjectShim(string file)
        {
            EngineShim  engine      = new EngineShim();
            ProjectShim projectShim = engine.CreateNewProject();

            projectShim.Load(file);

            return(projectShim);
        }
Пример #2
0
        /// <summary>
        /// Overloaded Constructor
        /// </summary>
        /// <param name="projectFilePath">path to the project file</param>
        /// <param name="serviceProvider">A service provider.</param>
        public ProjectSecurityChecker(IServiceProvider serviceProvider, string projectFilePath)
        {
            if (serviceProvider == null)
            {
                throw new ArgumentNullException("serviceProvider");
            }

            if (String.IsNullOrEmpty(projectFilePath))
            {
                throw new ArgumentException(SR.GetString(SR.ParameterCannotBeNullOrEmpty, CultureInfo.CurrentUICulture), "projectFilePath");
            }

            this.serviceProvider = serviceProvider;

            // Instantiate a new project shim that we are going to use for security checkings.
            EngineShim engine = new EngineShim();

            this.projectShim = engine.CreateNewProject();
            this.projectShim.Load(projectFilePath);
        }
		/// <summary>
		/// Overloaded Constructor 
		/// </summary>
		/// <param name="projectFilePath">path to the project file</param>
		/// <param name="serviceProvider">A service provider.</param>
		public ProjectSecurityChecker(IServiceProvider serviceProvider, string projectFilePath)
		{
			if(serviceProvider == null)
			{
				throw new ArgumentNullException("serviceProvider");
			}

			if(String.IsNullOrEmpty(projectFilePath))
			{
				throw new ArgumentException(SR.GetString(SR.ParameterCannotBeNullOrEmpty, CultureInfo.CurrentUICulture), "projectFilePath");
			}

			this.serviceProvider = serviceProvider;

			// Instantiate a new project shim that we are going to use for security checkings.
			EngineShim engine = new EngineShim();
			this.projectShim = engine.CreateNewProject();
			this.projectShim.Load(projectFilePath);
		}
Пример #4
0
        /// <summary>
        /// Creates a project shim from a project file.
        /// </summary>
        /// <param name="file">The path to the project file.</param>
        /// <returns>The project shim</returns>
        private static ProjectShim CreateProjectShim(string file)
        {
            EngineShim engine = new EngineShim();
            ProjectShim projectShim = engine.CreateNewProject();
            projectShim.Load(file);

            return projectShim;
        }