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
- HGlobalSafeHandle.cs
- JournalNavigationScope.cs
- GuidTagList.cs
- ArrayHelper.cs
- WindowsGraphics2.cs
- RuntimeWrappedException.cs
- XsdCachingReader.cs
- RoleManagerEventArgs.cs
- Util.cs
- MemoryRecordBuffer.cs
- MinMaxParagraphWidth.cs
- GenericEnumerator.cs
- Paragraph.cs
- Helpers.cs
- TransactionInterop.cs
- CompileLiteralTextParser.cs
- ControlBindingsCollection.cs
- BaseParser.cs
- AsymmetricKeyExchangeFormatter.cs
- TemplatePartAttribute.cs
- SchemaTypeEmitter.cs
- BrowserDefinition.cs
- ValidatorUtils.cs
- HtmlFormParameterReader.cs
- ColorInterpolationModeValidation.cs
- IgnorePropertiesAttribute.cs
- CompositeFontParser.cs
- XmlILCommand.cs
- EntityDataSourceStatementEditorForm.cs
- KeyFrames.cs
- Light.cs
- RawTextInputReport.cs
- ADConnectionHelper.cs
- ListItem.cs
- ColumnReorderedEventArgs.cs
- OAVariantLib.cs
- GrammarBuilderBase.cs
- LoginName.cs
- COMException.cs
- InputMethod.cs
- OdbcReferenceCollection.cs
- CodeCatchClauseCollection.cs
- HostVisual.cs
- DeploymentExceptionMapper.cs
- Internal.cs
- LockCookie.cs
- ConstraintConverter.cs
- SqlResolver.cs
- SafeMemoryMappedViewHandle.cs
- Canonicalizers.cs
- EntityAdapter.cs
- SQLByteStorage.cs
- TimeSpanParse.cs
- TextDecorationCollectionConverter.cs
- OdbcConnection.cs
- Int32.cs
- Run.cs
- HostedHttpTransportManager.cs
- MessageQueuePermissionEntryCollection.cs
- ListMarkerLine.cs
- ObjectListShowCommandsEventArgs.cs
- IndexingContentUnit.cs
- DataSourceCache.cs
- PresentationTraceSources.cs
- WorkflowInstance.cs
- SafeArchiveContext.cs
- Hashtable.cs
- ExternalFile.cs
- AuthStoreRoleProvider.cs
- ColumnPropertiesGroup.cs
- QilDataSource.cs
- SoapSchemaImporter.cs
- JsonXmlDataContract.cs
- SmtpException.cs
- ResolvedKeyFrameEntry.cs
- SelectionEditor.cs
- SessionParameter.cs
- ValueSerializer.cs
- DocumentGrid.cs
- ConfigurationSection.cs
- DeploymentSection.cs
- AttributeQuery.cs
- FacetEnabledSchemaElement.cs
- EntityCodeGenerator.cs
- NullableDoubleMinMaxAggregationOperator.cs
- TreeNodeEventArgs.cs
- SafeFileHandle.cs
- DBDataPermissionAttribute.cs
- CompilationUnit.cs
- MultiSelectRootGridEntry.cs
- EntryIndex.cs
- Graph.cs
- ExtractedStateEntry.cs
- VariableReference.cs
- MemoryFailPoint.cs
- CalendarDataBindingHandler.cs
- SupportsEventValidationAttribute.cs
- lengthconverter.cs
- ToolStripRenderer.cs
- PauseStoryboard.cs