XCore.PanelButton.IsRelatedProperty C# (CSharp) Method

IsRelatedProperty() public method

is what we are displaying affected by this XCore property?
public IsRelatedProperty ( string name ) : bool
name string
return bool
		public bool IsRelatedProperty(string name)
		{
			//for now, only handles Boolean properties
			BoolPropertyChoice choice = this.Tag as XCore.BoolPropertyChoice;
			if (choice == null)
				return false;

			return choice.BoolPropertyName == name;
		}

Usage Example

Beispiel #1
0
 /// <summary>
 /// XCore will call us whenever a property has changed.
 /// </summary>
 /// <param name="name"></param>
 public void OnPropertyChanged(string name)
 {
     //decide if something we are showing is affected by this property
     //foreach(PanelButton panel in m_propertiesToWatch)
     foreach (DictionaryEntry e in m_propertiesToWatch)
     {
         PanelButton panel = e.Value as PanelButton;
         if (panel.IsRelatedProperty(name))
         {
             panel.UpdateDisplay();
         }
     }
 }