Example #1
0
 /// <summary>
 /// Constructor taking a delegate for unit test purposes only
 /// </summary>
 internal ToolsetConfigurationReader(PropertyDictionary <ProjectPropertyInstance> environmentProperties, PropertyDictionary <ProjectPropertyInstance> globalProperties, Func <Configuration> readApplicationConfiguration)
     : base(environmentProperties, globalProperties)
 {
     ErrorUtilities.VerifyThrowArgumentNull(readApplicationConfiguration, "readApplicationConfiguration");
     _readApplicationConfiguration  = readApplicationConfiguration;
     _projectImportSearchPathsCache = new Dictionary <string, Dictionary <string, ProjectImportPathMatch> >(StringComparer.OrdinalIgnoreCase);
 }
Example #2
0
        /// <summary>
        /// Creates a new property
        /// </summary>
        /// <param name="name">The property name</param>
        /// <param name="value">The property value</param>
        /// <param name="source">The property source</param>
        public ToolsetPropertyDefinition(string name, string value, IElementLocation source)
        {
            ErrorUtilities.VerifyThrowArgumentLength(name, "name");
            ErrorUtilities.VerifyThrowArgumentNull(source, "source");

            // value can be the empty string but not null
            ErrorUtilities.VerifyThrowArgumentNull(value, "value");

            _name   = name;
            _value  = value;
            _source = source;
        }
Example #3
0
        /// <summary>
        /// Forces a removal of a project root element from the weak cache if it is present.
        /// </summary>
        /// <param name="projectRootElement">The project root element to remove.</param>
        /// <remarks>
        /// No exception is thrown if this project root element is in use by currently loaded projects
        /// by this method.  The calling method must know that this is a safe operation.
        /// There may of course be strong references to the project root element from customer code.
        /// The assumption is that when they instruct the project collection to unload it, which
        /// leads to this being called, they are releasing their strong references too (or it doesn't matter)
        /// </remarks>
        internal override void DiscardAnyWeakReference(ProjectRootElement projectRootElement)
        {
            ErrorUtilities.VerifyThrowArgumentNull(projectRootElement, "projectRootElement");

            // A PRE may be unnamed if it was only used in memory.
            if (projectRootElement.FullPath != null)
            {
                lock (_locker)
                {
                    _weakCache.Remove(projectRootElement.FullPath);
                }
            }
        }
Example #4
0
        /// <summary>
        /// Creates an instance of this class using the information in the given XmlException and file location.
        /// </summary>
        internal BuildEventFileInfo(string file, XmlException e) : this(e)
        {
            ErrorUtilities.VerifyThrowArgumentNull(file, nameof(file));

            _file = file;
        }