当前位置: 首页>>代码示例>>C#>>正文


C# PropertyInfo.NiceName方法代码示例

本文整理汇总了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;
        }
开发者ID:JackWangCUMT,项目名称:extensions,代码行数:13,代码来源:TranslatedInstance.cs

示例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);
        }
开发者ID:JackWangCUMT,项目名称:extensions,代码行数:7,代码来源:WordTemplate.cs

示例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;
        }
开发者ID:otamimi,项目名称:southwind,代码行数:10,代码来源:Address.cs

示例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);
        }
开发者ID:carlosesquivelunono,项目名称:extensions,代码行数:10,代码来源:ScheduleRule.cs

示例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);
        }
开发者ID:mapacheL,项目名称:extensions,代码行数:10,代码来源:ChartParameter.cs

示例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);
        }
开发者ID:SaintLoong,项目名称:extensions,代码行数:10,代码来源:ScheduleRule.cs

示例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);
        }
开发者ID:mapacheL,项目名称:extensions,代码行数:21,代码来源:UserChart.cs

示例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);
        }
开发者ID:mapacheL,项目名称:extensions,代码行数:7,代码来源:ScheduleRule.cs

示例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);
        }
开发者ID:JackWangCUMT,项目名称:extensions,代码行数:13,代码来源:DashboardEntity.cs

示例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);
        }
开发者ID:mapacheL,项目名称:extensions,代码行数:16,代码来源:UserQueryEntity.cs


注:本文中的System.Reflection.PropertyInfo.NiceName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。