Example #1
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);
        }