Code:
/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Tools / xws_reg / System / ServiceModel / Install / Configuration / BuildProviderInstallComponent.cs / 1 / BuildProviderInstallComponent.cs
//------------------------------------------------------------------------------ // Copyright (c) Microsoft Corporation. All rights reserved. //----------------------------------------------------------------------------- namespace System.ServiceModel.Install.Configuration { using System; using System.Collections.Generic; using System.Configuration; using System.Text; using System.Web.Configuration; using System.Xml; internal class BuildProviderInstallComponent : ServiceModelInstallComponent { ConfigurationLoader configLoader; string displayString; BuildProviderInstallComponent(ConfigurationLoader configLoader) { this.configLoader = configLoader; } internal override string DisplayName { get {return this.displayString; } } protected override string InstallActionMessage { get {return SR.GetString(SR.BuildProviderInstall, ServiceModelInstallStrings.BuildProvidersType); } } internal override string[] InstalledVersions { get { ListinstalledVersions = new List (); if (null != configLoader.SystemWebSectionGroup) { foreach (string buildProviderExtension in ServiceModelInstallStrings.BuildProviderExtensionValues) { BuildProvider buildProvider = configLoader.SystemWebSectionGroup.Compilation.BuildProviders[buildProviderExtension]; if (null != buildProvider) { string versionString = InstallHelper.GetVersionStringFromTypeString(buildProvider.Type); if (!String.IsNullOrEmpty(versionString)) { installedVersions.Add(versionString); } } } } return installedVersions.ToArray(); } } internal override bool IsInstalled { get { if (null != configLoader.SystemWebSectionGroup) { foreach (string buildProviderExtension in ServiceModelInstallStrings.BuildProviderExtensionValues) { BuildProvider buildProvider = configLoader.SystemWebSectionGroup.Compilation.BuildProviders[buildProviderExtension]; if (null != buildProvider) { return true; } } } return false; } } protected override string ReinstallActionMessage { get {return SR.GetString(SR.BuildProviderInstall, ServiceModelInstallStrings.BuildProvidersType); } } protected override string UninstallActionMessage { get {return SR.GetString(SR.BuildProviderUninstall, ServiceModelInstallStrings.BuildProvidersType); } } internal static BuildProviderInstallComponent CreateNativeBuildProviderInstallComponent() { BuildProviderInstallComponent buildProvider = new BuildProviderInstallComponent(new NativeConfigurationLoader()); buildProvider.displayString = SR.GetString(SR.BuildProviderName); return buildProvider; } internal static BuildProviderInstallComponent CreateWow64BuildProviderInstallComponent() { if (!InstallHelper.Is64BitMachine() || String.IsNullOrEmpty(InstallHelper.Wow64WebConfigFileName)) { throw new InvalidOperationException(SR.GetString(SR.Wow64NotInstalled)); } BuildProviderInstallComponent buildProvider = new BuildProviderInstallComponent(new Wow64ConfigurationLoader()); buildProvider.displayString = SR.GetString(SR.BuildProviderNameWow64); return buildProvider; } internal override void Install(OutputLevel outputLevel) { if (!this.IsInstalled) { if (null != configLoader.SystemWebSectionGroup) { foreach (string extensionValue in ServiceModelInstallStrings.BuildProviderExtensionValues) { BuildProvider buildProvider = new BuildProvider(extensionValue, ServiceModelInstallStrings.BuildProvidersType); configLoader.SystemWebSectionGroup.Compilation.BuildProviders.Add(buildProvider); configLoader.Save(); } } else { throw new InvalidOperationException(SR.GetString(SR.ConfigurationSectionNotInstalled, configLoader.SystemWebSectionGroupPath, configLoader.RootWebConfigurationFilePath)); } } else { EventLogger.LogWarning(SR.GetString(SR.BuildProviderAlreadyExists, ServiceModelInstallStrings.BuildProvidersType), (OutputLevel.Verbose == outputLevel)); } } internal override void Uninstall(OutputLevel outputLevel) { if (this.IsInstalled) { // Now, remove the other nodes foreach (string extensionValue in ServiceModelInstallStrings.BuildProviderExtensionValues) { configLoader.SystemWebSectionGroup.Compilation.BuildProviders.Remove(extensionValue); configLoader.Save(); } } else { EventLogger.LogWarning(SR.GetString(SR.BuildProviderNotInstalled, ServiceModelInstallStrings.BuildProvidersType), (OutputLevel.Verbose == outputLevel)); } } internal override InstallationState VerifyInstall() { InstallationState installState = InstallationState.Unknown; if (this.IsInstalled) { if (null != configLoader.SystemWebSectionGroup) { foreach (string extensionValue in ServiceModelInstallStrings.BuildProviderExtensionValues) { BuildProvider buildProvider = new BuildProvider(extensionValue, ServiceModelInstallStrings.BuildProvidersType); BuildProvider installedBuildProvider = configLoader.SystemWebSectionGroup.Compilation.BuildProviders[extensionValue]; if (installedBuildProvider.Equals(buildProvider)) { installState = InstallationState.InstalledDefaults; } else { installState = InstallationState.InstalledCustom; break; } } } } else { installState = InstallationState.NotInstalled; } return installState; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- GridItem.cs
- WebPartDescription.cs
- XmlILTrace.cs
- HtmlControlPersistable.cs
- DependencyStoreSurrogate.cs
- NullExtension.cs
- followingquery.cs
- LeftCellWrapper.cs
- panel.cs
- NonDualMessageSecurityOverHttpElement.cs
- AdvancedBindingPropertyDescriptor.cs
- XmlMembersMapping.cs
- ListViewDataItem.cs
- DataServiceQueryProvider.cs
- Constants.cs
- Collection.cs
- GridViewUpdateEventArgs.cs
- TextRunTypographyProperties.cs
- MessageBox.cs
- PageStatePersister.cs
- FlowDocumentPaginator.cs
- TextDpi.cs
- RecordsAffectedEventArgs.cs
- XmlDictionaryString.cs
- DataViewManager.cs
- _CommandStream.cs
- DataGridViewRowDividerDoubleClickEventArgs.cs
- OracleSqlParser.cs
- LoginName.cs
- Dispatcher.cs
- EmptyEnumerator.cs
- FamilyTypefaceCollection.cs
- AdPostCacheSubstitution.cs
- ProcessModelInfo.cs
- RegexBoyerMoore.cs
- OracleDataReader.cs
- ListViewItem.cs
- ObjectItemCollection.cs
- ResourcePool.cs
- DiagnosticsConfiguration.cs
- ScaleTransform3D.cs
- KeyValuePairs.cs
- HashRepartitionEnumerator.cs
- CryptoHelper.cs
- SurrogateSelector.cs
- PropertyPathConverter.cs
- LambdaCompiler.Lambda.cs
- ScriptReference.cs
- Hex.cs
- WebBodyFormatMessageProperty.cs
- CancelEventArgs.cs
- XamlGridLengthSerializer.cs
- ContextMenuService.cs
- sqlser.cs
- RegexMatchCollection.cs
- SqlColumnizer.cs
- xsdvalidator.cs
- GridPattern.cs
- COM2ColorConverter.cs
- DbParameterHelper.cs
- FileDialogPermission.cs
- VersionedStreamOwner.cs
- LogReserveAndAppendState.cs
- webeventbuffer.cs
- NumberSubstitution.cs
- DataGridViewCellLinkedList.cs
- LabelLiteral.cs
- DecoderBestFitFallback.cs
- PasswordTextNavigator.cs
- TagMapCollection.cs
- CheckoutException.cs
- SerializationHelper.cs
- MenuItemCollection.cs
- UDPClient.cs
- ExpressionBuilder.cs
- ChunkedMemoryStream.cs
- ReflectionHelper.cs
- UInt64Storage.cs
- ApplyTemplatesAction.cs
- SBCSCodePageEncoding.cs
- ErrorHandler.cs
- GlyphCollection.cs
- MailHeaderInfo.cs
- XmlNodeComparer.cs
- BindingMemberInfo.cs
- TrustSection.cs
- HtmlEncodedRawTextWriter.cs
- WorkflowApplicationAbortedException.cs
- XmlSchemaAnnotated.cs
- updateconfighost.cs
- BitmapEffectState.cs
- MobileFormsAuthentication.cs
- PropertyDescriptorGridEntry.cs
- AsyncContentLoadedEventArgs.cs
- TextContainerChangeEventArgs.cs
- Drawing.cs
- ConnectionOrientedTransportManager.cs
- EventManager.cs
- TextRangeProviderWrapper.cs
- BufferModeSettings.cs