Exemplo n.º 1
0
 public void ListenToBinding(string name)
 {
     if (_name != null)
     {
         StopListeningToBinding();
     }
     _name = name;
     BindingLabelUtils.AddLabelBinding(name, this);
 }
Exemplo n.º 2
0
        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;
                }
            }
        }
Exemplo n.º 3
0
 public void StopListeningToBinding()
 {
     BindingLabelUtils.RemoveLabelBinding(_name, this);
     _name = null;
 }