Exemplo n.º 1
0
 /// <summary>
 /// This function informs you about that a component has been removed from the framework.
 /// If your implementation has a reference in its implementation to that component,
 /// this is the time to assign null to that.
 /// </summary>
 public virtual void ComponentRemoved(object component)
 {
     if (component is IPropertyViewer)
     {
         IPropertyViewer property = component as IPropertyViewer;
         property.PropertyChanged -= PropertyChangedEventHandler;
         m_PropertyViewer.Remove(property);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// When this function gets called, your class gets informed about the addition of a new component in the system.
        /// You can check if the object you get as a parameter is something you're interested in
        /// and, if yes, do something with it, for example, store a reference to it in an internal member variable.
        /// </summary>
        public virtual void ComponentAdded(object component)
        {
            if (component is IPropertyViewer)
            {
                IPropertyViewer property = component as IPropertyViewer;

                m_PropertyViewer.Add(property);
                property.PropertyChanged += PropertyChangedEventHandler;
            }
        }