Пример #1
0
		/// <summary>
		/// Gets a configuration record for a specified library.
		/// </summary>
		/// <param name="descriptor">The descriptor of the library.</param>
		/// <returns>The configuration record or <B>null</B> if there is no record for the library.</returns>
		/// <exception cref="InvalidOperationException">Configuration not loaded.</exception>
		public IPhpConfiguration GetConfig(PhpLibraryDescriptor/*!*/ descriptor)
		{
			if (!IsConfigurationLoaded)
				throw new InvalidOperationException(CoreResources.GetString("configuration_not_loaded"));

			// libraries loaded after closing the configuration have greater unique indices:
			return (descriptor.UniqueIndex < _configurations.Length) ? _configurations[descriptor.UniqueIndex] : null;
		}
Пример #2
0
        /// <summary>
        /// Gets a configuration associated with the specified library.
        /// </summary>
        /// <param name="descriptor">The library descriptor.</param>
        /// <returns>The configuration.</returns>
        /// <exception cref="ArgumentNullException"><paramref name="descriptor"/> is a <B>null</B> reference.</exception>
        /// <exception cref="InvalidOperationException">Configuration has not been initialized yet.</exception>
        public IPhpConfiguration GetLibraryConfig(PhpLibraryDescriptor descriptor)
        {
            if (descriptor == null)
            {
                throw new ArgumentNullException("descriptor");
            }

            return(Library.GetConfig(descriptor));
        }
Пример #3
0
        /// <summary>
        /// Gets a configuration record for a specified library.
        /// </summary>
        /// <param name="descriptor">The descriptor of the library.</param>
        /// <returns>The configuration record or <B>null</B> if there is no record for the library.</returns>
        /// <exception cref="InvalidOperationException">Configuration not loaded.</exception>
        public IPhpConfiguration GetConfig(PhpLibraryDescriptor /*!*/ descriptor)
        {
            if (!IsConfigurationLoaded)
            {
                throw new InvalidOperationException(CoreResources.GetString("configuration_not_loaded"));
            }

            // libraries loaded after closing the configuration have greater unique indices:
            return((descriptor.UniqueIndex < _configurations.Length) ? _configurations[descriptor.UniqueIndex] : null);
        }
Пример #4
0
		public LibrarySection(PhpLibraryDescriptor/*!*/ descriptor)
		{
			Debug.Assert(descriptor != null);

			this.Descriptor = descriptor;
			this.UserContext = descriptor.CreateConfigContext();
		}
Пример #5
0
		/// <summary>
		/// Gets a configuration associated with the specified library.
		/// </summary>
		/// <param name="descriptor">The library descriptor.</param>
		/// <returns>The configuration.</returns>
		/// <exception cref="ArgumentNullException"><paramref name="descriptor"/> is a <B>null</B> reference.</exception>
		/// <exception cref="InvalidOperationException">Configuration has not been initialized yet.</exception>
		public IPhpConfiguration GetLibraryConfig(PhpLibraryDescriptor/*!*/ descriptor)
		{
			if (descriptor == null)
				throw new ArgumentNullException("descriptor");

			return Library.GetConfig(descriptor);
		}