private static void LoadBaseUrl(HelpProvider.HelpAppName appName) { switch (appName) { case HelpProvider.HelpAppName.Ecp: case HelpProvider.HelpAppName.Owa: case HelpProvider.HelpAppName.TenantMonitoring: HelpProvider.LoadBaseUrlViaADSession(appName); goto IL_52; case HelpProvider.HelpAppName.Setup: HelpProvider.LoadSetupBaseUrlFromRegistry(); goto IL_52; case HelpProvider.HelpAppName.Bpa: HelpProvider.LoadBpaBaseUrlFromRegistry(); goto IL_52; case HelpProvider.HelpAppName.Compliance: HelpProvider.LoadComplianceBaseUrl(); goto IL_52; } throw new InvalidOperationException("appName is not a valid HelpAppName enum. Check caller of Initialize how we get this value."); IL_52: HelpProvider.callingAppName = appName; }
public static Uri GetProductFeedbackUrl() { if (HelpProvider.initializedViaCmdlet) { return(HelpProvider.managementConsoleFeedbackUrl); } HelpProvider.HelpAppName helpAppName = HelpProvider.callingAppName; if (helpAppName == HelpProvider.HelpAppName.Ecp) { return(HelpProvider.controlPanelFeedbackUrl); } throw new InvalidOperationException(string.Format("callingAppName {0} is not a valid HelpAppName enum. Check caller of Initialize how we get this value.", HelpProvider.callingAppName.ToString())); }
private static void LoadBaseUrlViaCmdlet(HelpProvider.HelpAppName appName, RunspaceServerSettingsPresentationObject runspaceServerSettings, MonadConnectionInfo monadConnectionInfo) { if (appName != HelpProvider.HelpAppName.Toolbox) { if (appName != HelpProvider.HelpAppName.Eap) { throw new InvalidOperationException("appName is not a valid HelpAppName enum. Check caller of Initialize how we get this value."); } } try { ExchangeAssistance exchangeAssistance = null; MonadConnection connection = new MonadConnection("timeout=30", new CommandInteractionHandler(), runspaceServerSettings, monadConnectionInfo); using (new OpenConnection(connection)) { using (MonadCommand monadCommand = new MonadCommand("Get-ExchangeAssistanceConfig", connection)) { object[] array = monadCommand.Execute(); if (array != null && array.Length != 0) { exchangeAssistance = (array[0] as ExchangeAssistance); } } } if (exchangeAssistance != null) { if (exchangeAssistance.ManagementConsoleHelpURL != null) { HelpProvider.baseUrl = Utilities.NormalizeUrl(exchangeAssistance.ManagementConsoleHelpURL); } if (exchangeAssistance.ManagementConsoleFeedbackEnabled) { HelpProvider.managementConsoleFeedbackUrl = exchangeAssistance.ManagementConsoleFeedbackURL; } else { HelpProvider.managementConsoleFeedbackUrl = null; } if (exchangeAssistance.PrivacyLinkDisplayEnabled) { HelpProvider.privacyStatementUrl = exchangeAssistance.PrivacyStatementURL; } else { HelpProvider.privacyStatementUrl = null; } if (exchangeAssistance.WindowsLiveAccountURLEnabled) { HelpProvider.windowsLiveAccountUrl = exchangeAssistance.WindowsLiveAccountPageURL; } else { HelpProvider.windowsLiveAccountUrl = null; } if (exchangeAssistance.CommunityLinkDisplayEnabled) { HelpProvider.communityUrl = exchangeAssistance.CommunityURL; } else { HelpProvider.communityUrl = null; } } } catch (CommandExecutionException ex) { ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "CommandExecution Exception in LoadBaseURL: {0}", ex.Message); } catch (CmdletInvocationException ex2) { ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "CmdletInvocationException Exception in LoadBaseURL: {0}", ex2.Message); } catch (PipelineStoppedException ex3) { ExTraceGlobals.CoreTracer.TraceDebug <string>(0L, "PipelineStopped Exception in LoadBaseURL: {0}", ex3.Message); } HelpProvider.callingAppName = appName; }
private static void LoadBaseUrlViaADSession(HelpProvider.HelpAppName appName) { ExchangeAssistance exchangeAssistanceObjectFromAD = HelpProvider.GetExchangeAssistanceObjectFromAD(OrganizationId.ForestWideOrgId); if (exchangeAssistanceObjectFromAD != null) { HelpProvider.RegisterChangeNotification(exchangeAssistanceObjectFromAD.Id); if (appName.Equals(HelpProvider.HelpAppName.Ecp) || appName.Equals(HelpProvider.HelpAppName.TenantMonitoring)) { if (exchangeAssistanceObjectFromAD.ControlPanelHelpURL != null) { HelpProvider.baseUrl = Utilities.NormalizeUrl(exchangeAssistanceObjectFromAD.ControlPanelHelpURL); } if (exchangeAssistanceObjectFromAD.ControlPanelFeedbackEnabled) { HelpProvider.controlPanelFeedbackUrl = exchangeAssistanceObjectFromAD.ControlPanelFeedbackURL; } else { HelpProvider.controlPanelFeedbackUrl = null; } } else if (appName.Equals(HelpProvider.HelpAppName.Owa)) { if (exchangeAssistanceObjectFromAD.OWALightHelpURL != null) { HelpProvider.baseOwaLightUrl = exchangeAssistanceObjectFromAD.OWALightHelpURL; } if (exchangeAssistanceObjectFromAD.OWAHelpURL != null) { HelpProvider.baseOwaPremiumUrl = exchangeAssistanceObjectFromAD.OWAHelpURL; } if (exchangeAssistanceObjectFromAD.OWAFeedbackEnabled) { HelpProvider.owaPremiumFeedbackUrl = exchangeAssistanceObjectFromAD.OWAFeedbackURL; } else { HelpProvider.owaPremiumFeedbackUrl = null; } if (exchangeAssistanceObjectFromAD.OWALightFeedbackEnabled) { HelpProvider.owaLightFeedbackUrl = exchangeAssistanceObjectFromAD.OWALightFeedbackURL; } else { HelpProvider.owaLightFeedbackUrl = null; } } if (exchangeAssistanceObjectFromAD.PrivacyLinkDisplayEnabled) { HelpProvider.privacyStatementUrl = exchangeAssistanceObjectFromAD.PrivacyStatementURL; } else { HelpProvider.privacyStatementUrl = null; } if (exchangeAssistanceObjectFromAD.WindowsLiveAccountURLEnabled) { HelpProvider.windowsLiveAccountUrl = exchangeAssistanceObjectFromAD.WindowsLiveAccountPageURL; } else { HelpProvider.windowsLiveAccountUrl = null; } if (exchangeAssistanceObjectFromAD.CommunityLinkDisplayEnabled) { HelpProvider.communityUrl = exchangeAssistanceObjectFromAD.CommunityURL; return; } HelpProvider.communityUrl = null; } }
public static void InitializeViaCmdlet(HelpProvider.HelpAppName appName, RunspaceServerSettingsPresentationObject runspaceServerSettings, MonadConnectionInfo monadConnectionInfo) { HelpProvider.LoadBaseUrlViaCmdlet(appName, runspaceServerSettings, monadConnectionInfo); HelpProvider.initializedViaCmdlet = true; }
public static void Initialize(HelpProvider.HelpAppName appName) { HelpProvider.LoadBaseUrl(appName); HelpProvider.initializedViaCmdlet = false; }