ServiceModelInstallComponent.cs source code in C# .NET

Source code for the .NET framework in C#

                        

Code:

/ WCF / WCF / 3.5.30729.1 / untmp / Orcas / SP / ndp / cdf / src / WCF / Tools / xws_reg / System / ServiceModel / Install / ServiceModelInstallComponent.cs / 1 / ServiceModelInstallComponent.cs

                            //------------------------------------------------------------------------------ 
// Copyright (c) Microsoft Corporation.  All rights reserved.
//-----------------------------------------------------------------------------

namespace System.ServiceModel.Install 
{
    using System; 
 
    internal abstract class ServiceModelInstallComponent
    { 
        internal abstract string DisplayName
        {
            get;
        } 

        protected abstract string InstallActionMessage 
        { 
            get;
        } 

        internal abstract string[] InstalledVersions
        {
            get; 
        }
 
        internal abstract bool IsInstalled 
        {
            get; 
        }

        protected abstract string ReinstallActionMessage
        { 
            get;
        } 
 
        protected abstract string UninstallActionMessage
        { 
            get;
        }

        internal string GetActionString(InstallAction action) 
        {
            string retVal = string.Empty; 
 
            switch (action)
            { 
                case (InstallAction.Install):
                    retVal = this.InstallActionMessage;
                    break;
 
                case (InstallAction.Uninstall):
                    retVal = this.UninstallActionMessage; 
                    break; 

                case (InstallAction.Reinstall): 
                    retVal = this.ReinstallActionMessage;
                    break;
            }
 
            return retVal;
        } 
 
        internal abstract void Install(OutputLevel outputLevel);
        internal abstract void Uninstall(OutputLevel outputLevel); 
        internal abstract InstallationState VerifyInstall();

        internal virtual void Reinstall(OutputLevel outputLevel)
        { 
            if (OutputLevel.Quiet != outputLevel)
            { 
                EventLogger.LogToConsole(SR.GetString(SR.UninstallMessage, this.DisplayName)); 
            }
 
            EventLogger.WriteMsiStyleLogEntry(SR.GetString(SR.UninstallMessage, this.DisplayName));
            this.Uninstall(outputLevel);
            if (OutputLevel.Quiet != outputLevel)
            { 
                EventLogger.LogToConsole(SR.GetString(SR.InstallMessage, this.DisplayName));
            } 
 
            EventLogger.WriteMsiStyleLogEntry(SR.GetString(SR.InstallMessage, this.DisplayName));
            this.Install(outputLevel); 
        }
    }
}

// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
// Copyright (c) Microsoft Corporation. All rights reserved.
                        

Link Menu

Network programming in C#, Network Programming in VB.NET, Network Programming in .NET
This book is available now!
Buy at Amazon US or
Buy at Amazon UK