public void ListenToBinding(string name) { if (_name != null) { StopListeningToBinding(); } _name = name; BindingLabelUtils.AddLabelBinding(name, this); }
public Binding(T value = default(T), string discoverableName = null) { BindingsCleaner.Add(CleanupBinding); _value = value; _type = typeof(T); _name = discoverableName; labelProperty = new BindingLabelProperty(value as System.Object); if (_name != null) { BindingLabelUtils.AddLabelBinding(_name, labelProperty); if (!bindingsDictionary.ContainsKey(_name)) { bindingsDictionary.Add(_name, this); } else { Debug.LogWarning("Key {0} is already in use, assigning variable _name with null value and not adding it to bindingsDictionary"); _name = null; } } }
public void StopListeningToBinding() { BindingLabelUtils.RemoveLabelBinding(_name, this); _name = null; }