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


C# GridEntry.GetValueOwner方法代码示例

本文整理汇总了C#中System.Windows.Forms.PropertyGridInternal.GridEntry.GetValueOwner方法的典型用法代码示例。如果您正苦于以下问题:C# GridEntry.GetValueOwner方法的具体用法?C# GridEntry.GetValueOwner怎么用?C# GridEntry.GetValueOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Forms.PropertyGridInternal.GridEntry的用法示例。


在下文中一共展示了GridEntry.GetValueOwner方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: NotifyChildValue

 /// <include file='doc\GridEntry.uex' path='docs/doc[@for="GridEntry.NotifyChildValue"]/*' />
 /// <devdoc>
 /// Sends a notify message to the child GridEntry, and returns the success result
 /// </devdoc>
 internal virtual bool NotifyChildValue(GridEntry pe, int type) {
     
     return pe.NotifyValueGivenParent(pe.GetValueOwner(),type);
 }
开发者ID:JianwenSun,项目名称:cc,代码行数:8,代码来源:GridEntry.cs

示例3: NotifyParentChange

        protected override 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();

                // find the next property descriptor with a different parent
                while (!(ge is PropertyDescriptorGridEntry) || OwnersEqual(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) {
                        Array ownerArray = owner as Array;
                        if (ownerArray != null) {
                            for (int i = 0; i < ownerArray.Length; i++) {
                                PropertyDescriptor pd = ((PropertyDescriptorGridEntry)ge).propertyInfo;;

                                if (pd is MergePropertyDescriptor) {
                                    pd = ((MergePropertyDescriptor)pd)[i];
                                }

                                if (pd != null) {
                                    changeService.OnComponentChanging(ownerArray.GetValue(i), pd);
                                    changeService.OnComponentChanged(ownerArray.GetValue(i), pd, null, null);
                                }
                            }
                        }
                        else {
                            changeService.OnComponentChanging(owner, ((PropertyDescriptorGridEntry)ge).propertyInfo);
                            changeService.OnComponentChanged(owner, ((PropertyDescriptorGridEntry)ge).propertyInfo, null, null);
                        }
                    }
                }
            }
        }
开发者ID:JianwenSun,项目名称:cc,代码行数:47,代码来源:MultiPropertyDescriptorGridEntry.cs

示例4: 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);
                    }
                }
            }
        }
开发者ID:mind0n,项目名称:hive,代码行数:42,代码来源:PropertyDescriptorGridEntry.cs

示例5: NotifyParentChange

 protected override void NotifyParentChange(GridEntry ge)
 {
     while (((ge != null) && (ge is PropertyDescriptorGridEntry)) && ((PropertyDescriptorGridEntry) ge).propertyInfo.Attributes.Contains(NotifyParentPropertyAttribute.Yes))
     {
         object valueOwner = ge.GetValueOwner();
         while (!(ge is PropertyDescriptorGridEntry) || this.OwnersEqual(valueOwner, ge.GetValueOwner()))
         {
             ge = ge.ParentGridEntry;
             if (ge == null)
             {
                 break;
             }
         }
         if (ge != null)
         {
             valueOwner = ge.GetValueOwner();
             IComponentChangeService componentChangeService = this.ComponentChangeService;
             if (componentChangeService == null)
             {
                 continue;
             }
             Array array = valueOwner as Array;
             if (array != null)
             {
                 for (int i = 0; i < array.Length; i++)
                 {
                     PropertyDescriptor propertyInfo = ((PropertyDescriptorGridEntry) ge).propertyInfo;
                     if (propertyInfo is MergePropertyDescriptor)
                     {
                         propertyInfo = ((MergePropertyDescriptor) propertyInfo)[i];
                     }
                     if (propertyInfo != null)
                     {
                         componentChangeService.OnComponentChanging(array.GetValue(i), propertyInfo);
                         componentChangeService.OnComponentChanged(array.GetValue(i), propertyInfo, null, null);
                     }
                 }
                 continue;
             }
             componentChangeService.OnComponentChanging(valueOwner, ((PropertyDescriptorGridEntry) ge).propertyInfo);
             componentChangeService.OnComponentChanged(valueOwner, ((PropertyDescriptorGridEntry) ge).propertyInfo, null, null);
         }
     }
 }
开发者ID:pritesh-mandowara-sp,项目名称:DecompliedDotNetLibraries,代码行数:44,代码来源:MultiPropertyDescriptorGridEntry.cs


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