Beispiel #1
0
        private OwaHelpUrlData ReadAggregatedOwaHelpUrlData(UserConfigurationManager.IAggregationContext ctx, CultureInfo cultureInfo, OwaIdentity mailboxIdentity, UserAgent userAgent)
        {
            return(UserContextUtilities.ReadAggregatedType <OwaHelpUrlData>(ctx, "OWA.OwaHelpUrlData", delegate
            {
                HelpProvider.RenderingMode mode = HelpProvider.RenderingMode.Mouse;
                switch (userAgent.Layout)
                {
                case LayoutType.TouchNarrow:
                    mode = HelpProvider.RenderingMode.TNarrow;
                    break;

                case LayoutType.TouchWide:
                    mode = HelpProvider.RenderingMode.TWide;
                    break;

                case LayoutType.Mouse:
                    mode = HelpProvider.RenderingMode.Mouse;
                    break;
                }
                OrganizationProperties organizationProperties = null;
                if (mailboxIdentity != null)
                {
                    organizationProperties = mailboxIdentity.UserOrganizationProperties;
                }
                string helpUrl = HelpProvider.ConstructHelpRenderingUrl(cultureInfo.LCID, HelpProvider.OwaHelpExperience.Premium, string.Empty, mode, null, organizationProperties).ToString();
                return new OwaHelpUrlData
                {
                    HelpUrl = helpUrl
                };
            }));
        }
Beispiel #2
0
        private static string ConstructOwaOptionsHelpUrl(string helpId)
        {
            OrganizationProperties organizationProperties = null;

            OrganizationPropertyCache.TryGetOrganizationProperties(RbacPrincipal.Current.RbacConfiguration.OrganizationId, out organizationProperties);
            return(HelpProvider.ConstructHelpRenderingUrl(Thread.CurrentThread.CurrentUICulture.LCID, HelpProvider.OwaHelpExperience.Options, helpId, HelpProvider.RenderingMode.Mouse, null, organizationProperties).ToString());
        }
Beispiel #3
0
 internal static bool TryGetErrorAssistanceUrl(LocalizedException exception, OrganizationProperties organizationProperties, out Uri helpUrl)
 {
     helpUrl = null;
     if (!HelpProvider.ShouldConstructHelpUrlForException(exception))
     {
         return(false);
     }
     helpUrl = HelpProvider.UrlConstructHelper("ms.exch.err.default", new string[]
     {
         HelpProvider.GetErrorParam(exception),
         HelpProvider.GetLoginInfo(),
         (organizationProperties == null) ? string.Empty : HelpProvider.ConstructServicePlanInfo(organizationProperties.ServicePlan)
     });
     return(true);
 }
Beispiel #4
0
        public static Uri ConstructHelpRenderingUrl(int lcid, HelpProvider.OwaHelpExperience owaExp, string helpId, HelpProvider.RenderingMode mode, string optionalServerParams, OrganizationProperties organizationProperties)
        {
            Uri    owaBaseUrl      = HelpProvider.GetOwaBaseUrl(owaExp);
            string owaAppQualifier = HelpProvider.GetOwaAppQualifier(owaExp);
            string text            = optionalServerParams;

            if (!string.IsNullOrEmpty(text) && !text.StartsWith("&"))
            {
                text = "&" + text;
            }
            string text2 = HelpProvider.OwaLightNamespace;

            if (owaExp != HelpProvider.OwaHelpExperience.Light)
            {
                if (organizationProperties == null || string.IsNullOrEmpty(organizationProperties.ServicePlan))
                {
                    text2 = HelpProvider.OwaPremiumNamespace;
                }
                else if (organizationProperties.ServicePlan.StartsWith(HelpProvider.OwaMsoProfessionalServicePlanPrefix, StringComparison.InvariantCultureIgnoreCase))
                {
                    text2 = (HelpProvider.IsGallatin() ? HelpProvider.OwaMsoProfessionalGallatinNamespace : HelpProvider.OwaMsoProfessionalNamespace);
                }
                else
                {
                    text2 = (HelpProvider.IsGallatin() ? HelpProvider.OwaMsoEnterpriseGallatinNamespace : HelpProvider.OwaMsoEnterpriseNamespace);
                }
            }
            else
            {
                text = string.Empty;
            }
            string text3 = string.Empty;

            if (helpId != null)
            {
                text3 = "&helpid=" + owaAppQualifier + (helpId.Equals(string.Empty) ? "{0}" : helpId);
            }
            string text4 = "15";
            int    num   = HelpProvider.applicationVersion.IndexOf('.');

            if (num > 0)
            {
                text4 = HelpProvider.applicationVersion.Substring(0, num);
            }
            string uriString = string.Format("{0}?p1={1}&clid={2}&ver={3}&v={4}&mode={5}{6}{7}", new object[]
            {
                owaBaseUrl.ToString(),
                text2,
                lcid.ToString(),
                text4,
                HelpProvider.applicationVersion,
                HelpProvider.officeRedirModes[(int)mode],
                text3,
                text
            });

            return(new Uri(uriString));
        }