Ejemplo n.º 1
0
        public string GetHelpContentFromSharePoint(string heading, string sPContext, string helpListName,
                                                   string templateName)
        {
            if (!string.IsNullOrEmpty(heading))
            {
                heading = heading.Replace("\r", string.Empty).Trim();
                var query     = ListQueries.HelpGetItemQuery(templateName, heading);
                var helpList  = ListFactory.Create(helpListName, query);
                var presenter = new SharePointListPresenter(helpList, this);

                var fitem = presenter.GetHelpItems().FirstOrDefault();

                if (fitem != null)
                {
                    return(fitem.GetFieldValue(Constants.SharePointFields.Content));
                }

                var generalHelp = ListQueries.HelpGetItemQuery(templateName, Constants.SharePointFields.WizardHelp);
                helpList.UpdateCamlQuery(generalHelp);
                var gitem = presenter.GetHelpItems().FirstOrDefault();
                return(gitem != null
                    ? gitem.GetFieldValue(Constants.SharePointFields.Content)
                    : "Unable to find the help content for this document");
            }
            return("Unable to find the help content for this document");
        }