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

            NotifyActionPerformed(action);
            Type = type;
        }
示例#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);
 }
示例#3
0
 public void AddHook(PropertyChangedAction a)
 {
     if (hooks.Contains(a))
     {
         throw new System.Exception("adding property hook twice");
     }
     hooks.Add(a);
 }
示例#4
0
        internal void OnPropertyChanged(IDynamicProperty property, PropertyChangedAction action)
        {
            var tmp = PropertyChanged;

            if (tmp != null)
            {
                tmp(this, new DynamicPropertyChangedEventArgs(property, action));
            }
        }
示例#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);
     }
 }
示例#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;
 }
示例#9
0
 public OverlayEntryWrapper(string identifier)
 {
     Identifier       = identifier;
     PropertyChanged += (s, e) => PropertyChangedAction?.Invoke();
 }