protected static void AddLabelBinding(string nameOfBinding, BindingLabelProperty property) { if (!labelPropertyDictionary.ContainsKey(nameOfBinding)) { labelPropertyDictionary.Add(nameOfBinding, property); } }
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; } } }