本文整理汇总了C#中System.Windows.Forms.PropertyGridInternal.GridEntry.ClearCachedValues方法的典型用法代码示例。如果您正苦于以下问题:C# GridEntry.ClearCachedValues方法的具体用法?C# GridEntry.ClearCachedValues怎么用?C# GridEntry.ClearCachedValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Forms.PropertyGridInternal.GridEntry
的用法示例。
在下文中一共展示了GridEntry.ClearCachedValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: NotifyParentChange
protected virtual void NotifyParentChange(GridEntry ge)
{
while (((ge != null) && (ge is PropertyDescriptorGridEntry)) && ((PropertyDescriptorGridEntry) ge).propertyInfo.Attributes.Contains(NotifyParentPropertyAttribute.Yes))
{
object valueOwner = ge.GetValueOwner();
bool isValueType = valueOwner.GetType().IsValueType;
while ((!(ge is PropertyDescriptorGridEntry) || isValueType) ? valueOwner.Equals(ge.GetValueOwner()) : (valueOwner == ge.GetValueOwner()))
{
ge = ge.ParentGridEntry;
if (ge == null)
{
break;
}
}
if (ge != null)
{
valueOwner = ge.GetValueOwner();
IComponentChangeService componentChangeService = this.ComponentChangeService;
if (componentChangeService != null)
{
componentChangeService.OnComponentChanging(valueOwner, ((PropertyDescriptorGridEntry) ge).propertyInfo);
componentChangeService.OnComponentChanged(valueOwner, ((PropertyDescriptorGridEntry) ge).propertyInfo, null, null);
}
ge.ClearCachedValues(false);
PropertyGridView gridEntryHost = this.GridEntryHost;
if (gridEntryHost != null)
{
gridEntryHost.InvalidateGridEntryValue(ge);
}
}
}
}
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:32,代码来源:PropertyDescriptorGridEntry.cs
示例2: NotifyParentChange
protected virtual void NotifyParentChange(GridEntry ge) {
// now see if we need to notify the parent(s) up the chain
while (ge != null &&
ge is PropertyDescriptorGridEntry &&
((PropertyDescriptorGridEntry)ge).propertyInfo.Attributes.Contains(NotifyParentPropertyAttribute.Yes)) {
// find the next parent property with a differnet value owner
object owner = ge.GetValueOwner();
// Fix for Dev10 bug 584323:
// when owner is an instance of a value type,
// we can't just use == in the following while condition testing
bool isValueType = owner.GetType().IsValueType;
// find the next property descriptor with a different parent
while (!(ge is PropertyDescriptorGridEntry)
|| isValueType ? owner.Equals(ge.GetValueOwner()) : owner == ge.GetValueOwner()) {
ge = ge.ParentGridEntry;
if (ge == null) {
break;
}
}
// fire the change on that owner
if (ge != null) {
owner = ge.GetValueOwner();
IComponentChangeService changeService = ComponentChangeService;
if (changeService != null) {
changeService.OnComponentChanging(owner, ((PropertyDescriptorGridEntry)ge).propertyInfo);
changeService.OnComponentChanged(owner, ((PropertyDescriptorGridEntry)ge).propertyInfo, null, null);
}
ge.ClearCachedValues(false); //clear the value so it paints correctly next time.
PropertyGridView gv = this.GridEntryHost;
if (gv != null) {
gv.InvalidateGridEntryValue(ge);
}
}
}
}