Example #1
0
        private void ChangeType(GatewayType type)
        {
            PropertyChangedAction action = new PropertyChangedAction(this, Type, type, nameof(Type));

            NotifyActionPerformed(action);
            Type = type;
        }
Example #2
0
 public void RemoveHook(PropertyChangedAction a)
 {
     if (hooks.Contains(a) == false)
     {
         throw new System.Exception("removing property hook which is not even there");
     }
     hooks.Remove(a);
 }
Example #3
0
 public void AddHook(PropertyChangedAction a)
 {
     if (hooks.Contains(a))
     {
         throw new System.Exception("adding property hook twice");
     }
     hooks.Add(a);
 }
Example #4
0
        internal void OnPropertyChanged(IDynamicProperty property, PropertyChangedAction action)
        {
            var tmp = PropertyChanged;

            if (tmp != null)
            {
                tmp(this, new DynamicPropertyChangedEventArgs(property, action));
            }
        }
Example #5
0
 public override void OnPropertyChanged(string name)
 {
     if (RunOnUIAction != null)
     {
         RunOnUIAction.Invoke(() =>
         {
             base.OnPropertyChanged(name);
             PropertyChangedAction?.Invoke(name);
         });
     }
     else
     {
         base.OnPropertyChanged(name);
         PropertyChangedAction?.Invoke(name);
     }
 }
Example #6
0
 public void NotifyActionPropertyChagned(string propertyName, object value)
 {
     if (_lastProperty == null)
     {
         throw new NullReferenceException("Property not saved. Cannot raise event");
     }
     if (_lastProperty.Name == propertyName)
     {
         var property = GetType().GetProperty(propertyName);
         if (property == null)
         {
             throw new ArgumentException($"Property {propertyName} not found");
         }
         if (!value.Equals(_lastProperty.Value))
         {
             PropertyChangedAction action = new PropertyChangedAction(this, _lastProperty.Value, value, propertyName);
             NotifyActionPerformed(action);
         }
     }
     else
     {
         throw new ArgumentException($"Last property is {_lastProperty.Name} not {propertyName}");
     }
 }
 internal DynamicPropertyChangedEventArgs(IDynamicProperty property, PropertyChangedAction action)
 {
     this.Action   = action;
     this.Property = property;
 }
 public DynamicPropertyChangedEventArgs(IDynamicPropertyBase property, PropertyChangedAction action)
 {
     this.Action = action;
     this.Property = property;
 }
 public OverlayEntryWrapper(string identifier)
 {
     Identifier       = identifier;
     PropertyChanged += (s, e) => PropertyChangedAction?.Invoke();
 }