コード例 #1
0
        /// <summary>
        /// <para>Initializes this provider to the correct state and context used by the factory creating it.</para>
        /// </summary>
        /// <param name="configurationView">
        /// <para>The cursor to use to get the data specific for the transformer.</para>
        /// </param>
        /// <exception cref="ArgumentException">
        /// <para><paramref name="configurationView"/> must be of type <see cref="EnterpriseLibrary.Configuration.RuntimeConfigurationView"/>.</para>
        /// <para>- or -</para>
        /// <para>The <see cref="StorageProviderData"/> from the cursor should be of type <see cref="XmlFileStorageProviderData"/>.</para>
        /// </exception>
        /// <exception cref="ArgumentNullException">
        /// <para><paramref name="configurationView"/> is a <see langword="null"/> reference (Nothing in Visual Basic).</para>
        /// </exception>
        public override void Initialize(ConfigurationView configurationView)
        {
            ArgumentValidation.CheckForNullReference(configurationView, "configurationView");

            GetStorageCursor(configurationView);
            StorageProviderData storageProviderData = runtimeConfigurationView.GetStorageProviderData(CurrentSectionName);

            ArgumentValidation.CheckExpectedType(storageProviderData, typeof(XmlFileStorageProviderData));

            XmlFileStorageProviderData xmlFileStorageProvider = (XmlFileStorageProviderData)storageProviderData;

            SetCurrentDirectory(runtimeConfigurationView);
            SetApplicationDocumentPathSetting(xmlFileStorageProvider);
        }