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
- ObjectListCommandCollection.cs
- MetadataSerializer.cs
- ImageButton.cs
- XslUrlEditor.cs
- CompositeCollection.cs
- XmlSchemaObjectTable.cs
- FormattedTextSymbols.cs
- DescendentsWalker.cs
- ObjectItemLoadingSessionData.cs
- AuthenticationSection.cs
- InputLanguageProfileNotifySink.cs
- _DomainName.cs
- MissingMemberException.cs
- RepeatInfo.cs
- ListBoxChrome.cs
- SqlRecordBuffer.cs
- VisualTreeUtils.cs
- DynamicResourceExtension.cs
- Splitter.cs
- ToolStripLocationCancelEventArgs.cs
- SqlDataRecord.cs
- SmtpFailedRecipientException.cs
- DragStartedEventArgs.cs
- XmlSchemaComplexType.cs
- ListBoxAutomationPeer.cs
- ToolboxItemCollection.cs
- PrintPageEvent.cs
- KeyGestureConverter.cs
- SimpleWebHandlerParser.cs
- XamlGridLengthSerializer.cs
- VisualStyleTypesAndProperties.cs
- DeploymentExceptionMapper.cs
- ListBase.cs
- MatrixConverter.cs
- SqlTriggerContext.cs
- PagePropertiesChangingEventArgs.cs
- SafeRegistryKey.cs
- WindowsFont.cs
- basenumberconverter.cs
- HttpHandlerActionCollection.cs
- QueryConverter.cs
- NativeMethodsCLR.cs
- ResizeGrip.cs
- Interlocked.cs
- HtmlInputCheckBox.cs
- RawKeyboardInputReport.cs
- NavigationWindow.cs
- printdlgexmarshaler.cs
- MgmtResManager.cs
- ImageSourceValueSerializer.cs
- TransactionScope.cs
- PointAnimation.cs
- AsyncCompletedEventArgs.cs
- EmptyElement.cs
- FunctionMappingTranslator.cs
- CompilerInfo.cs
- QueryExtender.cs
- WasHostedComPlusFactory.cs
- designeractionbehavior.cs
- RadialGradientBrush.cs
- SerializationSectionGroup.cs
- ImageAttributes.cs
- HttpException.cs
- LongAverageAggregationOperator.cs
- XMLUtil.cs
- XmlChildNodes.cs
- BaseCollection.cs
- RoutedEventConverter.cs
- WebMessageEncoderFactory.cs
- BitmapPalettes.cs
- IndexedGlyphRun.cs
- CancellationHandler.cs
- FlowLayoutSettings.cs
- RestHandlerFactory.cs
- NativeMethods.cs
- unitconverter.cs
- ListItemCollection.cs
- FileDialogCustomPlace.cs
- LowerCaseStringConverter.cs
- KnownBoxes.cs
- WebPartConnectionsCloseVerb.cs
- SQlBooleanStorage.cs
- XmlDataSourceView.cs
- CaseInsensitiveComparer.cs
- TraceLevelStore.cs
- AddingNewEventArgs.cs
- DataMemberListEditor.cs
- FunctionQuery.cs
- ValidationRule.cs
- HybridDictionary.cs
- FileDialogCustomPlace.cs
- WorkflowInvoker.cs
- SamlAdvice.cs
- SelectionEditor.cs
- WindowInteractionStateTracker.cs
- SynchronizationContext.cs
- TrackingParameters.cs
- baseaxisquery.cs
- RC2CryptoServiceProvider.cs
- TextLineResult.cs