Class ContractExtensions
Extension methods on the classes defined in the Contracts assembly
Inheritance
ContractExtensions
Assembly: NipoSoftware.Nfield.TemplateHelpers.dll
Syntax
public static class ContractExtensions
Methods
AddAlphaDataAttributes(Contracts.Data.Open, HtmlHelper)
Adds data- attributes for the constraints on a Alpha
Declaration
public static IHtmlString AddAlphaDataAttributes(this Contracts.Data.Open open, HtmlHelper html)
Parameters
Returns
AddDataAttributes(Contracts.Data.CategoryList, HtmlHelper)
Adds data- attributes for the constraints for category question.
Declaration
public static IHtmlString AddDataAttributes(this Contracts.Data.CategoryList list, HtmlHelper html)
Parameters
Returns
AddDataAttributes(Contracts.Data.Open, HtmlHelper)
Adds data- attributes for the constraints on an Open
Declaration
public static IHtmlString AddDataAttributes(this Contracts.Data.Open open, HtmlHelper html)
Parameters
Returns
AddDataAttributes(Contracts.Data.Screen, HtmlHelper)
Adds data attributes for matrix container
Matrix template is NOT calling this method at the moment
TODO: Make sure Matrix view calls this extension method when the CAPI Client minimum version is set to 1.47
Declaration
public static IHtmlString AddDataAttributes(this Contracts.Data.Screen screen, HtmlHelper html)
Parameters
Returns
AddDataAttributes(Contracts.Data.Segment, HtmlHelper)
Declaration
public static IHtmlString AddDataAttributes(this Contracts.Data.Segment segment, HtmlHelper html)
Parameters
Returns
AdditionalClassString(Contracts.Data.Segment)
Declaration
public static string AdditionalClassString(this Contracts.Data.Segment segment)
Parameters
Returns
AddLineDataAttributes(Contracts.Data.Open, HtmlHelper)
Adds data- attributes for the constraints on a Line
Declaration
public static IHtmlString AddLineDataAttributes(this Contracts.Data.Open open, HtmlHelper html)
Parameters
Returns
AddNumberDataAttributes(Contracts.Data.Open, HtmlHelper)
Adds data- attributes for the constraints on a Number
Declaration
public static IHtmlString AddNumberDataAttributes(this Contracts.Data.Open open, HtmlHelper html)
Parameters
Returns
AsHtmlId(String, HtmlHelper, String, String)
Returns a string as an html id attribute
Declaration
public static IHtmlString AsHtmlId(this string value, HtmlHelper html, string prefix = null, string suffix = null)
Parameters
Returns
CreateParentingStructure(Contracts.Data.InterviewResult)
Create the parenting structure for the specified interviewResult
.
Declaration
public static Contracts.Data.InterviewResult CreateParentingStructure(this Contracts.Data.InterviewResult interviewResult)
Parameters
Returns
ErrorVisibility(Contracts.Data.Segment)
Determines visibility of the error message.
Declaration
public static string ErrorVisibility(this Contracts.Data.Segment segment)
Parameters
Returns
Type |
Description |
String |
Returns the string that determines the visibility of the error message.
|
GetAppIdForSegment(Contracts.Data.Segment)
Returns the configured Facebook application id for the segment.
Declaration
public static string GetAppIdForSegment(this Contracts.Data.Segment segment)
Parameters
Returns
GetConstraintValue(IEnumerable<Contracts.Data.Constraint>, String)
Get the value of a constraint
Declaration
public static string GetConstraintValue(this IEnumerable<Contracts.Data.Constraint> constraints, string name)
Parameters
Returns
GetStyles(Style)
Declaration
public static IEnumerable<string> GetStyles(this Style style)
Parameters
Type |
Name |
Description |
Style |
style |
|
Returns
IsExclusive(IEnumerable<Contracts.Data.Constraint>)
Determine if the constraints of a category make the category exclusive.
Declaration
public static bool IsExclusive(this IEnumerable<Contracts.Data.Constraint> constraints)
Parameters
Returns
NameForInput(Contracts.Data.Category)
Determine the value of the name attribute for a category
Declaration
public static string NameForInput(this Contracts.Data.Category category)
Parameters
Returns
NameForInput(Contracts.Data.Open)
Determine the value of the name attribute for a category
Declaration
public static string NameForInput(this Contracts.Data.Open open)
Parameters
Returns
RenderCheckedAttribute(Contracts.Data.Category)
Render 'radio' for exclusive categories and 'checkbox' for non-exclusive categories
Declaration
public static string RenderCheckedAttribute(this Contracts.Data.Category category)
Parameters
Returns
RenderInputType(Contracts.Data.Category)
Render 'radio' for exclusive categories and 'checkbox' for non-exclusive categories
Declaration
public static string RenderInputType(this Contracts.Data.Category category)
Parameters
Returns
RewriteMediaReferences(IEnumerable<KeyValuePair<String, String>>)
Declaration
public static IEnumerable<KeyValuePair<string, string>> RewriteMediaReferences(this IEnumerable<KeyValuePair<string, string>> originalOptions)
Parameters
Returns
SetCategoryLabel(Contracts.Data.Category, String)
Set the text label for a category
Declaration
public static void SetCategoryLabel(this Contracts.Data.Category category, string label)
Parameters
ToCssString(Style)
Declaration
public static string ToCssString(this Style style)
Parameters
Type |
Name |
Description |
Style |
style |
|
Returns
ToCssString(IEnumerable<Style>)
Declaration
public static string ToCssString(this IEnumerable<Style> styles)
Parameters
Returns
ToJavaScript(IEnumerable<Contracts.Data.ErrorMessage>)
Convert the error messages to a JSON object
Declaration
public static string ToJavaScript(this IEnumerable<Contracts.Data.ErrorMessage> errorMessages)
Parameters
Returns