示例#1
0
 public event EventHandler <EventArgs> ObjectChanged; //Об'єкт змінився - подія
 public void RaiseChanged()                           //Об'єкт змінився - пробудити подію
 {
     if (ObjectChanged != null)
     {
         ObjectChanged.Invoke(this, new EventArgs());
     }
 }
示例#2
0
        private void OnObjectChanged(Object obj)
        {
            ObjectChanged?.Invoke(obj);
            //=========================
            Thickness RealCM_Margin = MarginCM();

            MarginCM_Change.Invoke(RealCM_Margin);
        }
 private void btn_Save_Click(object sender, EventArgs e)
 {
     if (objectIsNew)
     {
         DataSource.Add(editObject);
     }
     StopEditMode();
     ObjectChanged?.Invoke(this, editObject);
 }
示例#4
0
        public void SetValue(object value)
        {
            Property.SetValue(Instance.ProxiedObject, value);

            ObjectChanged?.Invoke(new ObjectChangedEventArgs
            {
                Object       = Instance.ProxiedObject,
                PropertyName = Property.Name
            });
            Instance.RaisePropertyChanged(string.Empty);
        }
示例#5
0
        internal void DoObjectChanged(TabularObject obj, string propertyName, object oldValue, object newValue)
        {
            if (_disableUpdates)
            {
                return;
            }

            var e = new ObjectChangedEventArgs(obj, propertyName, oldValue, newValue);

            ObjectChanged?.Invoke(this, e);
        }
        public void Save <T>(T reference, Predicate <T> predicate) where T : Sprite, new()
        {
            if (reference == null)
            {
                return;
            }

            var obj = Query(predicate);

            obj = reference;

            ObjectChanged?.Invoke(obj);
        }
示例#7
0
 public void SetObject(T value)
 {
     if (!ReferenceEquals(_obj, value))
     {
         object old = _obj;
         if (_obj != null)
         {
             _obj.PropertyChanged -= _obj_PropertyChanged;
         }
         _obj = value;
         if (_obj != null)
         {
             _obj.PropertyChanged += _obj_PropertyChanged;
         }
         ObjectChanged?.Invoke(this, new ObjectChangedEventArgs(old));
         ObjectPropertyChanged?.Invoke(this, new PropertyChangedEventArgs(null));
     }
 }
示例#8
0
 /// <summary>
 /// Raises an ObjectChanged event.
 /// </summary>
 private void OnObjectChanged(object changeArgument)
 {
     ObjectChanged?.Invoke(this, new ObjectChangedEventArgs(commandConfig, changeArgument));
 }
示例#9
0
 /// <summary>
 /// Вызвать событие ObjectChanged
 /// </summary>
 private void OnObjectChanged(object changeArgument)
 {
     ObjectChanged?.Invoke(this, new ObjectChangedEventArgs(modbusCmd, changeArgument));
 }
示例#10
0
 private void _NotifyObservers()
 {
     ObjectChanged.Invoke(this, null);
 }
示例#11
0
 /// <summary>
 /// Raises an ObjectChanged event.
 /// </summary>
 private void OnObjectChanged(object changeArgument)
 {
     ObjectChanged?.Invoke(this, new ObjectChangedEventArgs(subscriptionConfig, changeArgument));
 }
示例#12
0
 /// <summary>
 /// Вызвать событие ObjectChanged
 /// </summary>
 private void OnObjectChanged(object changeArgument)
 {
     ObjectChanged?.Invoke(this, new ObjectChangedEventArgs(elemInfo, changeArgument));
 }
 private void OnObjectChanged(ObjectChangedEventArgs args)
 {
     ObjectChanged?.Invoke(this, args);
 }
 public void RaiseObjectChanged(CustomEventArgs <object> args)
 {
     ObjectChanged?.Invoke(this, args);
 }
 /// <summary>
 /// Raises the <see cref="ObjectChanged"/> event for the specified <paramref name="propertyName"/>.
 /// </summary>
 /// <param name="propertyName">Name of the changed property</param>
 protected virtual void RaiseObjectChanged(string propertyName)
 {
     ObjectChanged?.Invoke(this, propertyName);
 }
        internal void DoObjectChanged(TabularObject obj, string propertyName, object oldValue, object newValue)
        {
            var e = new ObjectChangedEventArgs(obj, propertyName, oldValue, newValue);

            ObjectChanged?.Invoke(this, e);
        }