Esempio n. 1
0
 public string GenerateConfiguredUrl(HelpConfigPage helpConfigPage)
 {
     return(String.Format(helpConfigPage.HelpUrl,
                          helpConfigPage.Application,
                          helpConfigPage.ApplicationUrl,
                          helpConfigPage.Language,
                          helpConfigPage.UserType).ToLower());
 }
Esempio n. 2
0
 public string GenerateConfiguredUrl(HelpConfigPage helpConfigPage)
 {
     return String.Format(helpConfigPage.HelpUrl,
         helpConfigPage.Application,
         helpConfigPage.ApplicationUrl,
         helpConfigPage.Language,
         helpConfigPage.UserType).ToLower();
 }
Esempio n. 3
0
        public string ResolveHelpUrl(HelpPage requestedHelpPage)
        {
            HelpConfigPage bestMatchingConfigPage = null;

            int currentBestMatchCount = 0;

            foreach (HelpConfigPage helpConfigPage in HelpConfigPages)
            {
                int attributeMatchCount = 0;

                if ((helpConfigPage.Application != "" && String.Compare(helpConfigPage.Application, requestedHelpPage.Application, true) != 0) ||
                    (helpConfigPage.ApplicationUrl != "" && String.Compare(helpConfigPage.ApplicationUrl, requestedHelpPage.ApplicationUrl, true) != 0) ||
                    (helpConfigPage.Language != "" && String.Compare(helpConfigPage.Language, requestedHelpPage.Language, true) != 0) ||
                    (helpConfigPage.UserType != "" && String.Compare(helpConfigPage.UserType, requestedHelpPage.UserType, true) != 0))
                {
                    continue;
                }

                if (String.Compare(helpConfigPage.Application, requestedHelpPage.Application, true) == 0)
                {
                    attributeMatchCount++;
                }
                if (String.Compare(helpConfigPage.ApplicationUrl, requestedHelpPage.ApplicationUrl, true) == 0)
                {
                    attributeMatchCount++;
                }
                if (String.Compare(helpConfigPage.Language, requestedHelpPage.Language, true) == 0)
                {
                    attributeMatchCount++;
                }
                if (String.Compare(helpConfigPage.UserType, requestedHelpPage.UserType, true) == 0)
                {
                    attributeMatchCount++;
                }

                if (attributeMatchCount > currentBestMatchCount)
                {
                    currentBestMatchCount  = attributeMatchCount;
                    bestMatchingConfigPage = helpConfigPage;
                }
            }
            return(bestMatchingConfigPage == null?GenerateDefaultUrl(requestedHelpPage) : GenerateConfiguredUrl(bestMatchingConfigPage));
        }