本文整理汇总了C#中DotNetNuke.UI.Modules.ModuleInstanceContext类的典型用法代码示例。如果您正苦于以下问题:C# ModuleInstanceContext类的具体用法?C# ModuleInstanceContext怎么用?C# ModuleInstanceContext使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ModuleInstanceContext类属于DotNetNuke.UI.Modules命名空间,在下文中一共展示了ModuleInstanceContext类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialise
public virtual void Initialise(string fieldTitle, string fieldType, int fieldId, int moduleId,
string controlHelpText, string defaultValue, bool required, string validationRule,
string validationMsg, string editStyle, string inputSettings,
string outputSettings, bool normalizeFlag, bool multipleValuesFlag,
bool inputFilterTags, bool inputFilterScript, InputType inputSettingsListType,
ModuleInstanceContext moduleContext, DataTable fieldSettingsTable,
IFormEvents formEvents)
{
FieldTitle = fieldTitle;
FieldType = fieldType;
FieldId = fieldId;
ModuleId = moduleId;
HelpText = controlHelpText;
DefaultValue = defaultValue;
Required = required;
ValidationRule = validationRule;
_customValidationMessage = validationMsg;
InputSettings = inputSettings;
OutputSettings = outputSettings;
Style = editStyle;
NormalizeFlag = normalizeFlag;
MultipleValuesFlag = multipleValuesFlag;
FilterScript = inputFilterScript;
FilterTags = inputFilterTags;
ListInputType = inputSettingsListType;
ModuleContext = moduleContext;
FieldSettingsTable = fieldSettingsTable;
FormEvents = formEvents;
}
示例2: GetTokens
/// <summary>
/// Implemtentation of the interface ICustomTokenProvider
/// </summary>
/// <param name="page"></param>
/// <param name="moduleContext"></param>
/// <returns></returns>
public IDictionary<string, IPropertyAccess> GetTokens(Page page, ModuleInstanceContext moduleContext)
{
var tokens = new Dictionary<string, IPropertyAccess>();
tokens["preloadeddata"] = new PreloadedDataPropertyAccess(moduleContext.PortalId);
tokens["contactsettings"] = new SettingsPropertyAccess(moduleContext.ModuleId, moduleContext.TabId);
return tokens;
}
示例3: Initialise
public void Initialise(ModuleInstanceContext context)
{
_moduleSettings = context.Settings;
Configuration = context.Configuration;
User = context.PortalSettings.UserInfo;
EditUrlPattern = context.EditUrl( DataTableColumn.RowId.ToString(CultureInfo.InvariantCulture), "{0}","edit");
}
示例4: SetTermPageMeta
/// <summary>
/// Sets the Page Meta information for the TagDetail.ascx view.
/// </summary>
/// <param name="defaultPage"></param>
/// <param name="objTerm"></param>
/// <param name="modContext"></param>
/// <param name="pageTitle"></param>
/// <param name="description"></param>
public static void SetTermPageMeta(CDefault defaultPage, TermInfo objTerm, ModuleInstanceContext modContext, string pageTitle, string description)
{
var title = TruncateString(pageTitle + " - " + modContext.PortalSettings.PortalName, Constants.SeoTitleLimit, false);
var content = TruncateString(description, Constants.SeoDescriptionLimit, false);
var link = Links.ViewTagDetail(modContext, modContext.TabId, objTerm.Name);
var keyWords = objTerm.Name;
SetPageMetaAndOpenGraph(defaultPage, modContext, title, content, keyWords, link);
}
示例5: SetQuestionPageMeta
/// <summary>
/// Sets the Page Meta information for the Question.ascx view.
/// </summary>
/// <param name="defaultPage"></param>
/// <param name="objQuestion"></param>
/// <param name="modContext"></param>
/// <remarks>Need to wire in page to accept page param in URL.</remarks>
public static void SetQuestionPageMeta(CDefault defaultPage,AlbumInfo objQuestion, ModuleInstanceContext modContext)
{
var title = TruncateString(objQuestion.AlbumName + " - " + modContext.PortalSettings.PortalName, Constants.SeoTitleLimit, false);
var content = TruncateString(objQuestion.ShortContent, Constants.SeoDescriptionLimit, false);
var link = Links.ViewQuestion(objQuestion.AlbumID, objQuestion.AlbumName, modContext.PortalSettings.ActiveTab, modContext.PortalSettings);
var keyWords = "";
var keyCount = 1;
var count = keyCount;
var terms=Conten
foreach (var term in objQuestion.Terms.TakeWhile(term => count <= Constants.SeoKeywordsLimit))
{
keyWords += "," + term.Name;
keyCount += 1;
}
SetPageMetaAndOpenGraph(defaultPage, modContext, title, content, keyWords, link);
}
示例6: SetHomePageMeta
/// <summary>
///
/// </summary>
/// <param name="defaultPage"></param>
/// <param name="modContext"></param>
/// <remarks>In this method we don't really want to override the dnn stuff, we simply want to add the OG stuff.</remarks>
public static void SetHomePageMeta(CDefault defaultPage, ModuleInstanceContext modContext)
{
var link = Links.Home(modContext.TabId);
var content = defaultPage.Description;
var title = defaultPage.Title;
var keyWords = defaultPage.KeyWords;
SetPageMetaAndOpenGraph(defaultPage, modContext, title, content, keyWords, link);
}
示例7: UrlHelper
public UrlHelper(ModuleInstanceContext context)
{
_context = context;
}
示例8: GetTokens
public IDictionary<string, IPropertyAccess> GetTokens(Page page, ModuleInstanceContext moduleContext)
{
var tokens = new Dictionary<string, IPropertyAccess>();
tokens["moduleproperties"] = new ModulePropertiesPropertyAccess(moduleContext);
return tokens;
}
示例9: ViewFilteredBadges
public static string ViewFilteredBadges(ModuleInstanceContext modContext, string filter)
{
return modContext.NavigateUrl(modContext.TabId, "", false, "view=" + Constants.PageScope.Badges.ToString().ToLower(), "filter=" + filter);
}
示例10: ViewUserAnswers
public static string ViewUserAnswers(ModuleInstanceContext modContext, int currentUserID)
{
return modContext.NavigateUrl(modContext.TabId, "", false, "view=" + Constants.PageScope.Browse.ToString().ToLower(), "type=answers", "user=" + currentUserID);
}
示例11: ViewUnansweredQuestions
public static string ViewUnansweredQuestions(ModuleInstanceContext modContext, int page, string sortBy)
{
if (page > 1)
{
return sortBy.Length > 0 ? modContext.NavigateUrl(modContext.TabId, "", false, "view=" + Constants.PageScope.Browse.ToString().ToLower(), "type=questions", "sort=" + sortBy, "unanswered=true", "page=" + page) : modContext.NavigateUrl(modContext.TabId, "", false, "view=" + Constants.PageScope.Browse.ToString().ToLower(), "type=questions", "unanswered=true", "page=" + page);
}
return sortBy.Length > 0 ? modContext.NavigateUrl(modContext.TabId, "", false, "view=" + Constants.PageScope.Browse.ToString().ToLower(), "type=questions", "sort=" + sortBy, "unanswered=true") : modContext.NavigateUrl(modContext.TabId, "", false, "view=" + Constants.PageScope.Browse.ToString().ToLower(), "type=questions", "unanswered=true");
}
示例12: ViewTermSynonyms
public static string ViewTermSynonyms(ModuleInstanceContext modContext, string termName)
{
return modContext.NavigateUrl(modContext.TabId, "", false, "view=" + Constants.PageScope.TermSynonyms.ToString().ToLower(), "term=" + HttpUtility.UrlEncode(termName));
}
示例13: ViewTagsSortedAndFiltered
/// <summary>
///
/// </summary>
/// <param name="modContext"></param>
/// <param name="filter"></param>
/// <param name="sortBy"></param>
/// <param name="page"></param>
/// <returns></returns>
public static string ViewTagsSortedAndFiltered(ModuleInstanceContext modContext, string filter, string sortBy, int page)
{
return page > 1 ? modContext.NavigateUrl(modContext.TabId, "", false, "view=" + Constants.PageScope.Tags.ToString().ToLower(), "filter=" + HttpUtility.UrlEncode(filter), "sort=" + sortBy, "page=" + page) : modContext.NavigateUrl(modContext.TabId, "", false, "view=" + Constants.PageScope.Tags.ToString().ToLower(), "filter=" + HttpUtility.UrlEncode(filter), "sort=" + sortBy);
}
示例14: ViewTagsSorted
/// <summary>
///
/// </summary>
/// <param name="modContext"></param>
/// <param name="sortBy"></param>
/// <param name="page"></param>
/// <returns></returns>
public static string ViewTagsSorted(ModuleInstanceContext modContext, string sortBy, int page)
{
return page > 1 ? modContext.NavigateUrl(modContext.TabId, "", false, "view=" + Constants.PageScope.Tags.ToString().ToLower(), "sort=" + sortBy, "page=" + page) : modContext.NavigateUrl(modContext.TabId, "", false, "view=" + Constants.PageScope.Tags.ToString().ToLower(), "sort=" + sortBy);
}
示例15: ViewBadge
public static string ViewBadge(ModuleInstanceContext modContext, string name, int id)
{
return modContext.NavigateUrl(modContext.TabId, "", false, "view=" + Constants.PageScope.Badge.ToString().ToLower(), "name=" + id, name);
}