internal object GetCommandViewModel(ShowCommandCommandInfo command, bool noCommonParameter, Dictionary <string, ShowCommandModuleInfo> importedModules, bool moduleQualify) { return(_graphicalHostReflectionWrapper.CallStaticMethod("GetCommandViewModel", command, noCommonParameter, importedModules, moduleQualify)); }
/// <summary> /// Helper method used to Write the help object onto the output /// stream or show online help (URI extracted from the HelpInfo) /// object. /// </summary> private void WriteObjectsOrShowOnlineHelp(HelpInfo helpInfo, bool showFullHelp) { if (helpInfo != null) { // online help can be showed only if showFullHelp is true.. // showFullHelp will be false when the help tries to display multiple help topics.. // -Online should not work when multiple help topics are displayed. if (showFullHelp && _showOnlineHelp) { bool onlineUriFound = false; // show online help s_tracer.WriteLine("Preparing to show help online."); Uri onlineUri = helpInfo.GetUriForOnlineHelp(); if (onlineUri != null) { onlineUriFound = true; LaunchOnlineHelp(onlineUri); return; } if (!onlineUriFound) { throw PSTraceSource.NewInvalidOperationException(HelpErrors.NoURIFound); } } #if !UNIX else if (showFullHelp && ShowWindow) { graphicalHostReflectionWrapper.CallStaticMethod("ShowHelpWindow", helpInfo.FullHelp, this); } #endif else { // show inline help if (showFullHelp) { if (Parameter != null) { GetAndWriteParameterInfo(helpInfo); } else { PSObject objectToReturn = TransformView(helpInfo.FullHelp); objectToReturn.IsHelpObject = true; WriteObject(objectToReturn); } } else { if (Parameter != null) { PSObject[] pInfos = GetParameterInfo(helpInfo); if ((pInfos == null) || (pInfos.Length == 0)) { return; } } WriteObject(helpInfo.ShortHelp); } } } }