/********************************************************************++
Copyright (c) Microsoft Corporation. All rights reserved.
--********************************************************************/
using System.Globalization;
using System.Diagnostics;
namespace System.Management.Automation.Help
{
///
/// Updatable help system internal representation of the PSModuleInfo class
///
internal class UpdatableHelpModuleInfo
{
internal static readonly string HelpContentZipName = "HelpContent.cab";
internal static readonly string HelpIntoXmlName = "HelpInfo.xml";
///
/// Class constructor
///
/// module name
/// module GUID
/// module path
/// HelpInfo URI
internal UpdatableHelpModuleInfo(string name, Guid guid, string path, string uri)
{
Debug.Assert(!String.IsNullOrEmpty(name));
Debug.Assert(guid != null);
Debug.Assert(!String.IsNullOrEmpty(path));
Debug.Assert(!String.IsNullOrEmpty(uri));
_moduleName = name;
_moduleGuid = guid;
_moduleBase = path;
_helpInfoUri = uri;
}
///
/// Module name
///
internal string ModuleName
{
get
{
return _moduleName;
}
}
private string _moduleName;
///
/// Module GUID
///
internal Guid ModuleGuid
{
get
{
return _moduleGuid;
}
}
private Guid _moduleGuid;
///
/// Module path
///
internal string ModuleBase
{
get
{
return _moduleBase;
}
}
private string _moduleBase;
///
/// HelpInfo URI
///
internal string HelpInfoUri
{
get
{
return _helpInfoUri;
}
}
private string _helpInfoUri;
///
/// Gets the combined HelpContent.zip name
///
/// current culture
/// HelpContent name
internal string GetHelpContentName(CultureInfo culture)
{
Debug.Assert(culture != null);
return _moduleName + "_" + _moduleGuid.ToString() + "_" + culture.Name + "_" + HelpContentZipName;
}
///
/// Gets the combined HelpInfo.xml name
///
/// HelpInfo name
internal string GetHelpInfoName()
{
return _moduleName + "_" + _moduleGuid.ToString() + "_" + HelpIntoXmlName;
}
}
}