本文整理汇总了C#中IPropertyInfo类的典型用法代码示例。如果您正苦于以下问题:C# IPropertyInfo类的具体用法?C# IPropertyInfo怎么用?C# IPropertyInfo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IPropertyInfo类属于命名空间,在下文中一共展示了IPropertyInfo类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StopIfNotFieldExists
/// <summary>
/// Initializes a new instance of the <see cref="StopIfNotFieldExists"/> class.
/// </summary>
/// <param name="primaryProperty">Primary property for this rule.</param>
public StopIfNotFieldExists(IPropertyInfo primaryProperty)
: base(primaryProperty)
{
if (InputProperties == null)
InputProperties = new List<IPropertyInfo>();
InputProperties.Add(primaryProperty);
}
示例2: FrequencyHoursShouldBeGreaterThanZeroRule
/// <summary>
/// Initializes a new instance of the <see cref="FrequencyHoursShouldBeGreaterThanZeroRule"/> class.
/// </summary>
/// <param name="hoursProperty">The hours property.</param>
/// <param name="frequencyTypePorperty">The frequency type property.</param>
/// <param name="frequencyFieldName">Name of the frequency field.</param>
public FrequencyHoursShouldBeGreaterThanZeroRule(IPropertyInfo hoursProperty, IPropertyInfo frequencyTypePorperty, string frequencyFieldName) : base(hoursProperty)
{
InputProperties = new List<IPropertyInfo> { hoursProperty, frequencyTypePorperty };
_frequencyTypeProperty = frequencyTypePorperty;
_frequencyFieldName = frequencyFieldName;
RuleUri.AddQueryParameter("frequencyFieldName", frequencyFieldName);
}
示例3: DefaultActivityStatus
public DefaultActivityStatus(IPropertyInfo activityIdProperty, IPropertyInfo activityStatusProperty, IPropertyInfo approvedByIdProperty)
: base(activityIdProperty)
{
if (activityIdProperty == null)
{
throw new ArgumentException("activityIdProperty cannot be null.");
}
if (activityStatusProperty == null)
{
throw new ArgumentException("activityStatusProperty cannot be null.");
}
if (approvedByIdProperty == null)
{
throw new ArgumentException("approvedByIdProperty cannot be null.");
}
if (activityIdProperty.Type != typeof(int))
{
throw new ArgumentException("activityIdProperty must be an int.");
}
if (activityStatusProperty.Type != typeof(ActivitySubmissionStatus))
{
throw new ArgumentException("activityStatusProperty must be a Common.Enums.ActivitySubmissionStatus.");
}
if (approvedByIdProperty.Type != typeof(int))
{
throw new ArgumentException("approvedByIdProperty must be a Common.Enums.ActivitySubmissionStatus.");
}
this.StatusName = activityStatusProperty.Name;
this.ApprovedByIdName = approvedByIdProperty.Name;
this.InputProperties = new List<IPropertyInfo> { activityIdProperty, activityStatusProperty, approvedByIdProperty };
this.AffectedProperties.Add(activityStatusProperty);
}
示例4: GreaterThanOrEqual
/// <summary>
/// Initializes a new instance of the <see cref="GreaterThanOrEqual"/> class.
/// </summary>
/// <param name="primaryProperty">
/// The primary property.
/// </param>
/// <param name="compareToProperty">
/// The compare to property.
/// </param>
public GreaterThanOrEqual(IPropertyInfo primaryProperty, IPropertyInfo compareToProperty)
: base(primaryProperty)
{
CompareTo = compareToProperty;
InputProperties = new List<IPropertyInfo>() { primaryProperty, compareToProperty };
this.RuleUri.AddQueryParameter("compareTo", compareToProperty.Name);
}
示例5: ResultFieldValidationRule
/// <summary>
/// Initializes a new instance of the <see cref="ResultFieldValidationRule"/> class.
/// </summary>
/// <param name="idProperty">The identifier property.</param>
/// <param name="resultProperty">The result property.</param>
/// <param name="resultListProperty">The result list property.</param>
public ResultFieldValidationRule(IPropertyInfo idProperty, IPropertyInfo resultProperty, IPropertyInfo resultListProperty)
: base(idProperty)
{
_resultProperty = resultProperty;
_resultListProperty = resultListProperty;
InputProperties = new List<IPropertyInfo> { idProperty, resultProperty, resultListProperty };
}
示例6: AnyRequired
public AnyRequired(IPropertyInfo primaryProperty, params IPropertyInfo[] additionalProperties)
: base(primaryProperty)
{
InputProperties = new List<IPropertyInfo>() {primaryProperty};
InputProperties.AddRange(additionalProperties);
this.RuleUri.AddQueryParameter("any", string.Join(",", additionalProperties.Select(p => p.Name).ToArray()));
}
示例7: PropertyRule
/// <summary>
/// Initializes a new instance of the <see cref="PropertyRule"/> class.
/// </summary>
/// <param name="propertyInfo">The property info.</param>
protected PropertyRule(IPropertyInfo propertyInfo)
: base(propertyInfo)
{
CanRunAsAffectedProperty = true;
CanRunOnServer = true;
CanRunInCheckRules = true;
}
示例8: CollectionMinimumCountBusinessRule
public CollectionMinimumCountBusinessRule(IPropertyInfo collectionProperty, int minCount)
: base(collectionProperty)
{
PrimaryProperty = collectionProperty;
InputProperties = new List<IPropertyInfo>() { collectionProperty };
_MinCount = minCount;
}
示例9: AsyncLookupRule
/// <summary>
/// Initializes a new instance of the <see cref="AsyncLookupRule"/> class.
/// </summary>
/// <param name="primaryProperty">Primary property for this rule.</param>
protected AsyncLookupRule(IPropertyInfo primaryProperty) : base(primaryProperty)
{
IsAsync = true;
CanRunAsAffectedProperty = false;
CanRunInCheckRules = false;
CanRunOnServer = false;
}
示例10: SetStateName
public SetStateName(IPropertyInfo stateIdProperty, IPropertyInfo stateNameProperty)
: base(stateIdProperty)
{
StateName = stateNameProperty;
InputProperties = new List<IPropertyInfo> { stateIdProperty };
AffectedProperties.Add(StateName);
}
示例11: NoDuplicates
public NoDuplicates(IPropertyInfo primaryProperty, IPropertyInfo idProperty, CheckForDuplicates duplicateCommand)
: base(primaryProperty)
{
if (primaryProperty == null)
{
throw new ArgumentException("primaryProperty cannot be null.");
}
if (idProperty == null)
{
throw new ArgumentException("idProperty cannot be null.");
}
if (duplicateCommand == null)
{
throw new ArgumentException("duplicateCommand cannot be null.");
}
if (primaryProperty.Type != typeof(string))
{
throw new ArgumentException("primaryProperty must be a string.");
}
if (idProperty.Type != typeof(int))
{
throw new ArgumentException("idProperty must be an int.");
}
this.IdPropertyName = idProperty.Name;
this.InputProperties = new List<IPropertyInfo> { primaryProperty, idProperty };
this.DuplicateCommand = duplicateCommand;
}
示例12: ParameterNameIsRequired
/// <summary>
/// Initializes a new instance of the <see cref="ParameterNameIsRequired"/> class.
/// </summary>
/// <param name="systemParameterListProperty">The system parameter list property.</param>
public ParameterNameIsRequired(IPropertyInfo systemParameterListProperty): base(systemParameterListProperty)
{
this.InputProperties = new List<IPropertyInfo> {systemParameterListProperty};
_required = new Csla.Rules.CommonRules.Required(systemParameterListProperty);
RuleUri.AddQueryParameter("rule", System.Uri.EscapeUriString(_required.RuleName));
}
示例13: PropertyXCanNotBeEmptyIfPropertyYHasValue
public PropertyXCanNotBeEmptyIfPropertyYHasValue(IPropertyInfo primaryProperty, IPropertyInfo dependentProperty)
: base(primaryProperty)
{
InputProperties = new List<IPropertyInfo> {primaryProperty, dependentProperty};
DependentProperty = dependentProperty;
MessageText = ResourcesValidation.PropertyXCantBeEmptyIfPropertyYHasValue;
}
示例14: DefaultBadgeStatus
public DefaultBadgeStatus(IPropertyInfo badgeTypeProperty, IPropertyInfo badgeStatusProperty, IPropertyInfo approvedByIdProperty)
: base(badgeTypeProperty)
{
if (badgeTypeProperty == null)
{
throw new ArgumentException("badgeIdProperty cannot be null.");
}
if (badgeStatusProperty == null)
{
throw new ArgumentException("badgeStatusProperty cannot be null.");
}
if (approvedByIdProperty == null)
{
throw new ArgumentException("approvedByIdProperty cannot be null.");
}
if (badgeTypeProperty.Type != typeof(BadgeType))
{
throw new ArgumentException("badgeTypeProperty must be a Common.Enums.BadgeType.");
}
if (badgeStatusProperty.Type != typeof(BadgeStatus))
{
throw new ArgumentException("badgeStatusProperty must be a Common.Enums.BadgeStatus.");
}
if (approvedByIdProperty.Type != typeof(int))
{
throw new ArgumentException("approvedByIdProperty must be an int.");
}
this.StatusName = badgeStatusProperty.Name;
this.ApprovedByIdName = approvedByIdProperty.Name;
this.InputProperties = new List<IPropertyInfo> { badgeTypeProperty, badgeStatusProperty, approvedByIdProperty };
this.AffectedProperties.Add(badgeStatusProperty);
}
示例15: IsAlreadyLoadingProperty
private bool IsAlreadyLoadingProperty(IPropertyInfo property)
{
lock (_syncRoot)
{
return _loading.Any(l => l.Property == property);
}
}