本文整理匯總了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);
}
}
}
}