Example #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
                };
            }));
        }
Example #2
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));
        }