本文整理汇总了C#中System.Reflection.PropertyInfo.NiceName方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyInfo.NiceName方法的具体用法?C# PropertyInfo.NiceName怎么用?C# PropertyInfo.NiceName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Reflection.PropertyInfo
的用法示例。
在下文中一共展示了PropertyInfo.NiceName方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PropertyValidation
protected override string PropertyValidation(PropertyInfo pi)
{
if (pi.Name == nameof(RowId) && PropertyRoute != null)
{
if (RowId == null && PropertyRoute.Path.Contains("/"))
return "{0} should be set for route {1}".FormatWith(pi.NiceName(), PropertyRoute);
if (RowId != null && !PropertyRoute.Path.Contains("/"))
return "{0} should be null for route {1}".FormatWith(pi.NiceName(), PropertyRoute);
}
return null;
}
示例2: PropertyValidation
protected override string PropertyValidation(PropertyInfo pi)
{
if (pi.Name == nameof(Template) && Template == null && Active)
return ValidationMessage._0IsNotSet.NiceToString(pi.NiceName());
return base.PropertyValidation(pi);
}
示例3: PropertyValidation
protected override string PropertyValidation(PropertyInfo pi)
{
if (pi.Name == nameof(PostalCode))
{
if (string.IsNullOrEmpty(PostalCode) && Country != "Ireland")
return Signum.Entities.ValidationMessage._0IsNotSet.NiceToString().FormatWith(pi.NiceName());
}
return null;
}
示例4: PropertyValidation
protected override string PropertyValidation(PropertyInfo pi)
{
if (pi.Is(() => EachMinutes))
{
if ((60 % EachMinutes) != 0)
return SchedulerMessage._0IsNotMultiple1.NiceToString().FormatWith(pi.NiceName(), 60);
}
return base.PropertyValidation(pi);
}
示例5: PropertyValidation
protected override string PropertyValidation(PropertyInfo pi)
{
if (pi.Name == nameof(Name) && Name != scriptParameter.Name)
return ValidationMessage._0ShouldBe12.NiceToString(pi.NiceName(), ComparisonType.EqualTo.NiceToString(), scriptParameter.Name);
if (pi.Name == nameof(Value))
return ScriptParameter.Valdidate(this.Value, this.ScriptParameter.GetToken(this.ParentChart));
return base.PropertyValidation(pi);
}
示例6: PropertyValidation
protected override string PropertyValidation(PropertyInfo pi)
{
if (pi.Name == nameof(EachHours))
{
if ((24 % EachHours) != 0)
return SchedulerMessage._0IsNotMultiple1.NiceToString().FormatWith(pi.NiceName(), 24);
}
return base.PropertyValidation(pi);
}
示例7: PropertyValidation
protected override string PropertyValidation(PropertyInfo pi)
{
if (pi.Name == nameof(Parameters) && Parameters != null && ChartScript != null)
{
try
{
EnumerableExtensions.JoinStrict(
Parameters,
ChartScript.Parameters,
p => p.Name,
ps => ps.Name,
(p, ps) => new { p, ps }, pi.NiceName());
}
catch (Exception e)
{
return e.Message;
}
}
return base.PropertyValidation(pi);
}
示例8: PropertyValidation
protected override string PropertyValidation(PropertyInfo pi)
{
if (pi.Name == nameof(Monday) && !(Monday || Tuesday || Wednesday || Thursday || Friday || Saturday || Sunday || Holiday))
return ValidationMessage._0IsNotSet.NiceToString(pi.NiceName());
return base.PropertyValidation(pi);
}
示例9: PropertyValidation
protected override string PropertyValidation(PropertyInfo pi)
{
if (pi.Name == nameof(EmbeddedInEntity))
{
if (EmbeddedInEntity == null && EntityType != null)
return ValidationMessage._0IsNecessary.NiceToString(pi.NiceName());
if (EmbeddedInEntity != null && EntityType == null)
return ValidationMessage._0IsNotAllowed.NiceToString(pi.NiceName());
}
return base.PropertyValidation(pi);
}
示例10: PropertyValidation
protected override string PropertyValidation(PropertyInfo pi)
{
if (pi.Name == nameof(ElementsPerPage))
{
if (ElementsPerPage != null && !ShouldHaveElements)
return UserQueryMessage._0ShouldBeNullIf1Is2.NiceToString().FormatWith(pi.NiceName(), NicePropertyName(() => PaginationMode), PaginationMode?.Let(pm => pm.NiceToString()) ?? "");
if (ElementsPerPage == null && ShouldHaveElements)
return UserQueryMessage._0ShouldBeSetIf1Is2.NiceToString().FormatWith(pi.NiceName(), NicePropertyName(() => PaginationMode), PaginationMode.NiceToString());
}
if (pi.Name == nameof(Filters) && WithoutFilters && Filters.Any())
return UserQueryMessage._0ShouldBeEmptyIf1IsSet.NiceToString().FormatWith(pi.NiceName(), ReflectionTools.GetPropertyInfo(() => WithoutFilters).NiceName());
return base.PropertyValidation(pi);
}