/********************************************************************++ Copyright (c) Microsoft Corporation. All rights reserved. --********************************************************************/ using System; using System.Globalization; using System.Management.Automation; using System.Management.Automation.Host; using Dbg = System.Diagnostics; namespace Microsoft.PowerShell { /// /// This is the default host implementing PSHost offering minimal host capabilities. /// Runspace is the primary user of this class. /// internal class DefaultHost : PSHost { #region ctor /// /// Creates an instance based on the current culture and current UI culture /// /// Current culture for this host /// Current UI culture for this host /// internal DefaultHost(CultureInfo currentCulture, CultureInfo currentUICulture) { CurrentCulture = currentCulture; CurrentUICulture = currentUICulture; } #endregion ctor #region properties /// See base class public override string Name { get { return "Default Host"; } } /// See base class public override Version Version { get; } = PSVersionInfo.PSVersion; /// See base class public override Guid InstanceId { get; } = Guid.NewGuid(); /// /// See base class /// This property is not supported /// public override PSHostUserInterface UI { get { return null; } } /// /// See base class /// public override CultureInfo CurrentCulture { get; } = null; /// /// See base class /// public override CultureInfo CurrentUICulture { get; } = null; #endregion properties #region methods /// /// /// See base class /// /// /// /// public override void SetShouldExit(int exitCode) { // No op } /// /// /// See base class /// /// /// /// /// /// On calling this method /// /// public override void EnterNestedPrompt() { throw PSTraceSource.NewNotSupportedException(); } /// /// /// See base class /// /// /// /// /// /// On calling this method /// /// public override void ExitNestedPrompt() { throw PSTraceSource.NewNotSupportedException(); } /// /// /// See base class /// /// /// /// public override void NotifyBeginApplication() { // No op } /// /// /// See base class /// /// /// /// public override void NotifyEndApplication() { // No op } #endregion methods #region private fields #endregion private fields } }