Esempio n. 1
0
        void UnsubscribeFromPropertyChangeNotifications(object instance)
        {
            INotifyPropertyChanged objectWithEvent = instance as INotifyPropertyChanged;

            if (objectWithEvent != null)
            {
                objectWithEvent.PropertyChanged -= SelectionPropertyChanged;
            }
            IPropertyGridHost supportsHost = instance as IPropertyGridHost;

            if (supportsHost != null)
            {
                supportsHost.PropertyGrid = null;
            }
        }
Esempio n. 2
0
        void SubscribeToPropertyChangeNotifications(object instance)
        {
            INotifyPropertyChanged objectWithEvent = instance as INotifyPropertyChanged;

            if (objectWithEvent != null)
            {
                objectWithEvent.PropertyChanged += this.SelectionPropertyChanged;
            }
            IPropertyGridHost supportsHost = instance as IPropertyGridHost;

            if (supportsHost != null)
            {
                supportsHost.PropertyGrid = this;
            }
        }