本文整理汇总了C#中ParameterList.GetParameter方法的典型用法代码示例。如果您正苦于以下问题:C# ParameterList.GetParameter方法的具体用法?C# ParameterList.GetParameter怎么用?C# ParameterList.GetParameter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ParameterList
的用法示例。
在下文中一共展示了ParameterList.GetParameter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
var metaTags = new List<XElement>();
string contentType = parameters.GetParameter<string>("ContentType");
string designer = parameters.GetParameter<string>("Designer");
bool showGenerator = parameters.GetParameter<bool>("ShowGenerator");
if (!string.IsNullOrWhiteSpace(contentType))
{
metaTags.Add(new XElement(Namespaces.Xhtml + "meta",
new XAttribute("http-equiv", "Content-Type"),
new XAttribute("content", contentType)));
}
if (!string.IsNullOrWhiteSpace(designer))
{
metaTags.Add(new XElement(Namespaces.Xhtml + "meta",
new XAttribute("name", "Designer"),
new XAttribute("content", designer)));
}
if (showGenerator)
{
metaTags.Add(new XElement(Namespaces.Xhtml + "meta",
new XAttribute("name", "Generator"),
new XAttribute("content", "Composite C1 CMS - Free Open Source from http://composite.net/")));
}
return metaTags;
}
示例2: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
IEnumerable<string> strings = parameters.GetParameter<IEnumerable<string>>("Strings");
string separator = parameters.GetParameter<string>("Separator");
return string.Join(separator, strings.ToArray());
}
示例3: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
IComparable valueA = parameters.GetParameter<IComparable>("ValueA");
IComparable valueB = parameters.GetParameter<IComparable>("ValueB");
return valueA.CompareTo(valueB);
}
示例4: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
IEnumerable elements = parameters.GetParameter<IEnumerable>("Elements");
string keyPropertyName = parameters.GetParameter<string>("KeyPropertyName");
string valuePropertyName = parameters.GetParameter<string>("ValuePropertyName");
Dictionary<string, string> resultDictionary = new Dictionary<string, string>();
PropertyInfo keyPropertyInfo = null;
PropertyInfo valuePropertyInfo = null;
foreach (object element in elements)
{
if (keyPropertyInfo == null)
{
keyPropertyInfo = element.GetType().GetProperty(keyPropertyName);
}
if (valuePropertyInfo == null)
{
valuePropertyInfo = element.GetType().GetProperty(valuePropertyName);
}
string keyValue = keyPropertyInfo.GetValue(element, null).ToString();
string valueValue = valuePropertyInfo.GetValue(element, null).ToString();
resultDictionary.Add(keyValue, valueValue);
}
return resultDictionary;
}
示例5: GetWidgetMarkup
/// <exclude />
public override XElement GetWidgetMarkup(ParameterList parameters, string label, HelpDefinition help, string bindingSourceName)
{
XElement element = base.BuildBasicWidgetMarkup("InlineXhtmlEditor", "Xhtml", label, help, bindingSourceName);
element.Add(new XAttribute("ClassConfigurationName", parameters.GetParameter<string>(ClassConfigurationNameParameterName)));
var pageId = parameters.GetParameter<Guid>(PreviewPageIdParameterName);
var templateId = parameters.GetParameter<Guid>(PreviewTemplateIdParameterName);
string placeholderName = parameters.GetParameter<string>(PreviewPlaceholderParameterName);
if (pageId != Guid.Empty)
{
element.Add(new XAttribute("PreviewPageId", pageId));
}
if (templateId != Guid.Empty)
{
element.Add(new XAttribute("PreviewTemplateId", templateId));
}
if (!string.IsNullOrEmpty(placeholderName))
{
element.Add(new XAttribute("PreviewPlaceholder", placeholderName));
}
return element;
}
示例6: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
object valueA = parameters.GetParameter<object>("ValueA");
object valueB = parameters.GetParameter<object>("ValueB");
return valueA.Equals(valueB);
}
示例7: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
var result = new List<FormEmail>();
result.AddRange(parameters.GetParameter<IEnumerable<FormEmail>>("EmailA"));
result.AddRange(parameters.GetParameter<IEnumerable<FormEmail>>("EmailB"));
return result;
}
示例8: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
return new TitleControl {
PrefixToRemove = parameters.GetParameter<string>("PrefixToRemove"),
PostfixToRemove = parameters.GetParameter<string>("PostfixToRemove")
};
}
示例9: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
string stringA = parameters.GetParameter<string>("StringA");
string stringB = parameters.GetParameter<string>("StringB");
string separator = parameters.GetParameter<string>("Separator");
return stringA + separator + stringB;
}
示例10: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
if (HttpContext.Current != null && HttpContext.Current.Request != null)
{
HttpContext.Current.Session[parameters.GetParameter<string>("VariableName")] = parameters.GetParameter<string>("Value");
}
return null;
}
示例11: GetWidgetMarkup
public override XElement GetWidgetMarkup(ParameterList parameters, string label, HelpDefinition help, string bindingSourceName)
{
XElement boolSelectorMarkup = base.BuildBasicWidgetMarkup("BoolSelector", "IsTrue", label, help, bindingSourceName);
boolSelectorMarkup.Add(new XAttribute("TrueLabel", parameters.GetParameter<string>(BoolSelectorWidgetFuntion.TrueLabelParameterName)));
boolSelectorMarkup.Add(new XAttribute("FalseLabel", parameters.GetParameter<string>(BoolSelectorWidgetFuntion.FalseLabelParameterName)));
return boolSelectorMarkup;
}
示例12: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
string stringToSplit = parameters.GetParameter<string>("String");
string[] separator = new string[] { parameters.GetParameter<string>("Separator") };
var resultArray = stringToSplit.Split(separator, StringSplitOptions.RemoveEmptyEntries);
return new List<string>(resultArray);
}
示例13: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
if (HttpContext.Current != null && HttpContext.Current.Request != null)
{
string result = HttpContext.Current.Request.Form[parameters.GetParameter<string>("ParameterName")];
return XmlConvert.ToDateTime(result, XmlDateTimeSerializationMode.Local);
}
return parameters.GetParameter<DateTime>("FallbackValue");
}
示例14: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
if (HttpContext.Current != null && HttpContext.Current.Request != null)
{
string result = HttpContext.Current.Request.Form[parameters.GetParameter<string>("ParameterName")];
if (result != null) return decimal.Parse(result);
}
return parameters.GetParameter<decimal>("FallbackValue");
}
示例15: Execute
public override object Execute(ParameterList parameters, FunctionContextContainer context)
{
if (HttpContext.Current != null && HttpContext.Current.Request != null)
{
string result = HttpContext.Current.Request.QueryString[parameters.GetParameter<string>("ParameterName")];
if (result != null) return new Guid(result);
}
return parameters.GetParameter<Guid>("FallbackValue");
}