本文整理汇总了C#中System.ComponentModel.PropertyDescriptor.CanResetValue方法的典型用法代码示例。如果您正苦于以下问题:C# PropertyDescriptor.CanResetValue方法的具体用法?C# PropertyDescriptor.CanResetValue怎么用?C# PropertyDescriptor.CanResetValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.ComponentModel.PropertyDescriptor
的用法示例。
在下文中一共展示了PropertyDescriptor.CanResetValue方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: _ResetProperty
private void _ResetProperty(PropertyDescriptor pd)
{
if (pd.CanResetValue(this.objectContext)) {
pd.ResetValue(this.objectContext);
OnPropertyChanged(new PropertyChangedEventArgs(pd.Name));
}
}
示例2: SetFont
/// <summary>
/// Sets the font for a property editing control</summary>
/// <param name="control">Property editing control</param>
/// <param name="descriptor">Property descriptor</param>
protected void SetFont(Control control, PropertyDescriptor descriptor)
{
Sce.Atf.Dom.AttributePropertyDescriptor attr_descriptor = descriptor as Sce.Atf.Dom.AttributePropertyDescriptor;
if ((attr_descriptor != null) && (attr_descriptor.AttributeInfo.Type.Type == Sce.Atf.Dom.AttributeTypes.String))
{
control.Font = null;
}
else
{
bool isOverride = descriptor.CanResetValue(LastSelectedObject);
control.Font = isOverride ? BoldFont : null;
}
}
示例3: CanResetProperty
/// <summary>
/// Returns whether or not the property can be reset</summary>
/// <param name="owners">Objects whose property is tested</param>
/// <param name="descriptor">Property to reset</param>
/// <returns>True iff the property can be reset on the object</returns>
public static bool CanResetProperty(IEnumerable<object> owners, PropertyDescriptor descriptor)
{
foreach (object owner in owners)
if (!descriptor.CanResetValue(owner))
return false;
return true;
}
示例4: _ResetProperty
private void _ResetProperty(PropertyDescriptor pd)
{
if (pd.CanResetValue(this.objectContext)) {
pd.ResetValue(this.objectContext);
}
}
示例5: CanResetValue
/// <summary>
/// Tests if the property values for the current selection can be reset</summary>
/// <param name="descriptor">Property descriptor representing property</param>
/// <returns>True iff the property values for the current selection can be reset</returns>
public bool CanResetValue(PropertyDescriptor descriptor)
{
foreach (object selected in m_selection)
if (!descriptor.CanResetValue(selected))
return false;
return true;
}