本文整理汇总了C#中ElementRequest.ValueIsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# ElementRequest.ValueIsEmpty方法的具体用法?C# ElementRequest.ValueIsEmpty怎么用?C# ElementRequest.ValueIsEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ElementRequest
的用法示例。
在下文中一共展示了ElementRequest.ValueIsEmpty方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SetSelectedValue
private static void SetSelectedValue(ElementRequest request, SelectTag select)
{
if (!request.ValueIsEmpty())
{
select.SelectByValue(request.Value<int>().ToString());
}
}
示例2: GetValue
private MonthOfYear GetValue(ElementRequest request)
{
var value = MonthOfYear.Current;
if (!request.ValueIsEmpty())
{
value = request.Value<MonthOfYear>();
}
return value;
}
示例3: BuildTag
protected override HtmlTag BuildTag(ElementRequest request)
{
var tag = new CalendarTextBox(request.ElementId);
if (request.ValueIsEmpty())
{
return tag;
}
var value = request.Value<DateTime>();
return tag.SetDate(value);
}
示例4: BuildTag
protected override HtmlTag BuildTag(ElementRequest request)
{
var tag = Tags.Span;
if (request.ValueIsEmpty())
{
return tag;
}
var value = request.Value<DateTime>();
tag.Text(value.ToShortDateString());
return tag;
}
示例5: BuildTag
protected override HtmlTag BuildTag(ElementRequest request)
{
var tag = Tags.Span;
if (request.ValueIsEmpty())
{
return tag;
}
var text = ((Enum) request.RawValue).ToDescription();
return tag
.Text(text);
}
示例6: BuildTag
protected override HtmlTag BuildTag(ElementRequest request)
{
var tag = Tags.Span;
if (request.ValueIsEmpty())
{
return tag;
}
var text = GetNamesOfFlagsThatAreSet(request)
.StringJoin(", ");
return tag
.Text(text);
}
示例7: BuildTag
protected override HtmlTag BuildTag(ElementRequest request)
{
var tag = Tags.Span;
if (request.ValueIsEmpty())
{
return tag;
}
var value = request.Value<int>();
var type = RemoveNullableIfNecessary(request.Accessor.PropertyType);
var options = EnumHelper.GetOptions(type);
var values = options.Where(o => (value & (int) o.GetValue(null)) > 0).Select(o => o.Name).ToArray();
tag.Text(String.Join(", ", values));
return tag;
}
示例8: BuildOptions
private Action<SelectTag> BuildOptions(ElementRequest req)
{
var hasBlankOption = req.Accessor.HasAttribute<WithBlankOption>();
return tag =>
{
var options = GetOptions(req);
if (hasBlankOption)
{
tag.Option("", "");
}
foreach (var f in options)
{
tag.Option(GetText(f, req), f.GetRawConstantValue().ToString());
}
if (!req.ValueIsEmpty())
{
tag.SelectByValue(req.Value<int>().ToString());
}
};
}
示例9: BuildTag
protected override HtmlTag BuildTag(ElementRequest request)
{
var date = request.ValueIsEmpty() ? (DateTime?) null : request.Value<DateTime>();
return new CalendarTextBox(request.ElementId, date);
}
示例10: GetValue
protected virtual string GetValue(ElementRequest request)
{
return request.ValueIsEmpty() ? string.Empty : request.StringValue();
}