private void InternalPropertyChangedHandler(object sender, ObjectChangeEventArgs e) { if (e.PropertyName == "Quantity") { GetDefaultSchedule().Qty = (int)e.NewValue; } }
void ObjectDomainBase_Changed(object sender, ObjectChangeEventArgs e) { if (!string.IsNullOrEmpty(e.PropertyName)) { needUpdate = true; } }
private void Session_ObjectChanged(object sender, ObjectChangeEventArgs e) { if (e.Reason == ObjectChangeReason.PropertyChanged) { btnSave.Enabled = true; } }
private void CurrentObjectOnChanged(object sender, ObjectChangeEventArgs objectChangeEventArgs) { if (objectChangeEventArgs.PropertyName == nameof(IXpoModelDifference.XmlContent)) { _xmlContentChanged = true; } }
protected override void TriggerObjectChanged(ObjectChangeEventArgs args) { if (!CancelTriggerObjectChanged) { base.TriggerObjectChanged(args); } }
private void Flow_Changed(object sender, ObjectChangeEventArgs e) { if (e.PropertyName == "IsDesignMode") { UpdateDesignerMode((bool)e.NewValue); } }
private void person_Changed(object sender, ObjectChangeEventArgs e) { if (e.PropertyName != null) { IsDirty = true; } }
private void baseUnitOfWork1_ObjectChanged(object sender, ObjectChangeEventArgs e) { if (e.Reason == ObjectChangeReason.PropertyChanged) { if (sender is Disbalance) { if (e.PropertyName == "Profit") { ProfitSpinEdit1.EditValue = e.NewValue; } else if (e.PropertyName == "Cost") { CostSpinEdit1.EditValue = e.NewValue; } else if (e.PropertyName == "CostPercentLast") { CostPercentLastSpinEdit1.EditValue = e.NewValue; } else if (e.PropertyName == "Value") { ValueSpinEdit1.EditValue = e.NewValue; } else if (e.PropertyName == "ValuePercentLast") { ValuePercentLastSpinEdit1.EditValue = e.NewValue; } } } }
private void OpenSaveControl_FileObjectChanged(object sender, ObjectChangeEventArgs e) { var xx = ObjectConverter == null ? (e as ObjectChangeEventArgs).Object : ObjectConverter.ConvertBack(e.Object, null, null, null); Content.Command.Execute(e); }
public void ObjectChangeHandler(object sender, ObjectChangeEventArgs e) { if (e.Reason == ObjectChangeReason.CancelEdit) { RemoveFromObjectToSaveIfNeeded(unitOfWork, e.Object); } EvalTransactionState(); }
public ChangeEventArgs(ObjectChangeEventArgs objectChangeEventArgs, Expression <Func <T, TProp> > property) { _property = property; Entity = objectChangeEventArgs.Object as T; NewValue = objectChangeEventArgs.NewValue as TProp; OldValue = objectChangeEventArgs.OldValue as TProp; }
private void Session_ObjectChanged(object sender, ObjectChangeEventArgs e) { if (e.Reason == ObjectChangeReason.PropertyChanged || // the customer property modified e.Reason == ObjectChangeReason.Reset // an order is modified ) { btnSave.Enabled = true; } }
protected override void TriggerObjectChanged(ObjectChangeEventArgs args) { XPBaseObject.RaiseChangedEvent(this, args); if (IsInvalidated) { return; } base.TriggerObjectChanged(args); }
void CurrentObjectOnChanged(object sender, ObjectChangeEventArgs objectChangeEventArgs) { if (objectChangeEventArgs.PropertyName == "XmlContent") { var aspect = _masterModel.CurrentAspect; _masterModel = _modelLoader.GetMasterModel(false); CreateModelEditorController(aspect); } }
void CurrentObjectOnChanged(object sender, ObjectChangeEventArgs objectChangeEventArgs) { if (objectChangeEventArgs.PropertyName == "XmlContent") { var aspect = _masterModel.CurrentAspect; InterfaceBuilder.SkipAssemblyCleanup = true; _masterModel = GetMasterModel(false); InterfaceBuilder.SkipAssemblyCleanup = false; CreateModelEditorController(aspect); } }
private void Item1_Changed(object sender, ObjectChangeEventArgs e) { if (!_propertiesAlreadyChanged.ContainsKey(e.PropertyName)) { _propertiesAlreadyChanged[e.PropertyName] = new List <XPBaseObject>(); } if (!_propertiesAlreadyChanged[e.PropertyName].Contains(sender as XPBaseObject)) { _propertiesAlreadyChanged[e.PropertyName].Add(sender as XPBaseObject); } }
protected override void TriggerObjectChanged(ObjectChangeEventArgs args) { if (!string.IsNullOrEmpty(args.PropertyName)) { var mi = ClassInfo.FindMember(args.PropertyName); if (mi != null && mi.ReferenceType != null) { base.TriggerObjectChanged(new ObjectChangeEventArgs(args.Session, args.Object, args.Reason, args.PropertyName + "!", args.OldValue, args.NewValue)); } } base.TriggerObjectChanged(args); }
private void DBObject_Changed(object sender, ObjectChangeEventArgs args) { IsChanged = true; }
private void Item1_Changed(object sender, ObjectChangeEventArgs e){ if (!_propertiesAlreadyChanged.ContainsKey(e.PropertyName)) _propertiesAlreadyChanged[e.PropertyName] = new List<XPBaseObject>(); if (!_propertiesAlreadyChanged[e.PropertyName].Contains(sender as XPBaseObject)) _propertiesAlreadyChanged[e.PropertyName].Add(sender as XPBaseObject); }
static void UnitOfWorkObjectChanged(object sender, ObjectChangeEventArgs e) { System.Diagnostics.Debug.WriteLine("UnitOfWorkObjectChanged()"); }
// public void OnCurrentPaymentChanged(object sender, ObjectChangeEventArgs e) { OnChanged("CurrentPayment"); }
void CurrentObjectOnChanged(object sender, ObjectChangeEventArgs objectChangeEventArgs) { if (objectChangeEventArgs.PropertyName == "XmlContent") { var aspect = _masterModel.CurrentAspect; InterfaceBuilder.SkipAssemblyCleanup = true; _masterModel = _modelLoader.GetMasterModel(false); InterfaceBuilder.SkipAssemblyCleanup = false; CreateModelEditorController(aspect); } }
private static void XPBaseObjectChanged(object sender, ObjectChangeEventArgs e) { System.Diagnostics.Debug.WriteLine("XPBaseObject: OnChanged"); }
void OnCustomerObjectChange(object sender, ObjectChangeEventArgs e) { this.RaiseCanExecuteChanged(x => x.Save()); }
protected override void TriggerObjectChanged(ObjectChangeEventArgs args) { if (!CancelTriggerObjectChanged) base.TriggerObjectChanged(args); }
void CurrentObjectOnChanged(object sender, ObjectChangeEventArgs objectChangeEventArgs) { if (objectChangeEventArgs.PropertyName == "XmlContent") { var aspect = _masterModel.CurrentAspect; _masterModel = _modelLoader.GetMasterModel(true); _controller = GetModelEditorController(aspect); } }
/// <summary> /// Handles the ObjectChanged event of the session control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="DevExpress.Xpo.ObjectChangeEventArgs"/> instance containing the event data.</param> private void session_ObjectChanged(object sender, ObjectChangeEventArgs e) { if (e.Object == null) { return; } if (e.Session.IsObjectMarkedDeleted(e.Object)) { return; } if (isMaintenanceObject(e.Object)) { return; } if (isMaintenanceProperty(e.Object, e.PropertyName)) { return; } switch (e.Reason) { case ObjectChangeReason.BeginEdit: case ObjectChangeReason.CancelEdit: case ObjectChangeReason.EndEdit: case ObjectChangeReason.Reset: // refresh old values for object trackedObjects.Refresh(e.Object); break; case ObjectChangeReason.PropertyChanged: if (!string.IsNullOrEmpty(e.PropertyName)) { var session = e.Session; var propertyName = e.PropertyName; var propMember = session.GetClassInfo(e.Object).FindMember(propertyName); if (propMember == null || propMember.IsCollection) { return; } // get new and old values var newValue = e.NewValue; if (e.OldValue == e.NewValue && e.NewValue == null) { newValue = propMember.GetValue(e.Object); } var oldValue = e.OldValue; if (!session.IsNewObject(e.Object)) { oldValue = trackedObjects.GetPropertyOldValue(e.Object, propertyName); } // DC many to many collections if (isDCManyToManyLink(propMember)) { if (e.OldValue != null) { registerDcManyToManyChange(e.Object, propMember, e.OldValue, ProtocolEventType.RemovedFromCollection, false); } if (e.NewValue != null) { registerDcManyToManyChange(e.Object, propMember, e.NewValue, ProtocolEventType.AddedToCollection, false); } break; } var eventType = session.IsNewObject(e.Object) && sessionEvents.ProtocolEvents.Find(x => x.Target == e.Object && x.ProtocolEventType == ProtocolEventType.ObjectCreated) == null ? ProtocolEventType.InitialValueAssigned : ProtocolEventType.ObjectChanged; // for InitialValueAssigned events replication key is null var replicationKeyValue = eventType == ProtocolEventType.InitialValueAssigned ? null : trackedObjects.GetReplicationKeyOldValue(e.Object); RegisterProtocolEvent(new ProtocolEvent { Target = e.Object, ProtocolEventType = eventType, PropertyName = propertyName, NewValue = newValue, OldValue = oldValue, ReplicationKey = replicationKeyValue }); // assume new value = old value trackedObjects.SetPropertyOldValue(e.Object, propertyName, newValue); // refresh replication key old value var replKeyMember = ExtensionsHelper.GetReplicationKeyMember(e.Object); if (replKeyMember != null) { var newReplicationKeyValue = ExtensionsHelper.GetReplicationKey(e.Object); if (newReplicationKeyValue != replicationKeyValue) { trackedObjects.SetPropertyOldValue(e.Object, replKeyMember.Name, newReplicationKeyValue); } } } break; } }
void OnVideoRentObjectChanged(object sender, ObjectChangeEventArgs e) { RaiseChanged(); }
protected void OnCurrentObjectChanged(object sender, ObjectChangeEventArgs e) { MessageBox.Show("aaa"); }
// TODO: move logic to view controller private void CashFlow_Changed(object sender, ObjectChangeEventArgs e) { if (!this.IsLoading) { } }
/// <summary> /// Handles the ObjectChanged event of the session control. /// </summary> /// <param name="sender">The source of the event.</param> /// <param name="e">The <see cref="DevExpress.Xpo.ObjectChangeEventArgs"/> instance containing the event data.</param> private void session_ObjectChanged(object sender, ObjectChangeEventArgs e) { if(e.Object == null) return; if (e.Session.IsObjectMarkedDeleted(e.Object)) return; if (isMaintenanceObject(e.Object)) return; if (isMaintenanceProperty(e.Object, e.PropertyName)) return; switch (e.Reason) { case ObjectChangeReason.BeginEdit: case ObjectChangeReason.CancelEdit: case ObjectChangeReason.EndEdit: case ObjectChangeReason.Reset: // refresh old values for object trackedObjects.Refresh(e.Object); break; case ObjectChangeReason.PropertyChanged: if (!string.IsNullOrEmpty(e.PropertyName)) { var session = e.Session; var propertyName = e.PropertyName; var propMember = session.GetClassInfo(e.Object).FindMember(propertyName); if (propMember == null || propMember.IsCollection) return; // get new and old values var newValue = e.NewValue; if (e.OldValue == e.NewValue && e.NewValue == null) newValue = propMember.GetValue(e.Object); var oldValue = e.OldValue; if (!session.IsNewObject(e.Object)) oldValue = trackedObjects.GetPropertyOldValue(e.Object, propertyName); // DC many to many collections if (isDCManyToManyLink(propMember)) { if (e.OldValue != null) registerDcManyToManyChange(e.Object, propMember, e.OldValue, ProtocolEventType.RemovedFromCollection, false); if (e.NewValue != null) registerDcManyToManyChange(e.Object, propMember, e.NewValue, ProtocolEventType.AddedToCollection, false); break; } var eventType = session.IsNewObject(e.Object) && sessionEvents.ProtocolEvents.Find(x => x.Target == e.Object && x.ProtocolEventType == ProtocolEventType.ObjectCreated) == null ? ProtocolEventType.InitialValueAssigned : ProtocolEventType.ObjectChanged; // for InitialValueAssigned events replication key is null var replicationKeyValue = eventType == ProtocolEventType.InitialValueAssigned ? null : trackedObjects.GetReplicationKeyOldValue(e.Object); RegisterProtocolEvent(new ProtocolEvent { Target = e.Object, ProtocolEventType = eventType, PropertyName = propertyName, NewValue = newValue, OldValue = oldValue, ReplicationKey = replicationKeyValue }); // assume new value = old value trackedObjects.SetPropertyOldValue(e.Object, propertyName, newValue); // refresh replication key old value var replKeyMember = ExtensionsHelper.GetReplicationKeyMember(e.Object); if (replKeyMember != null) { var newReplicationKeyValue = ExtensionsHelper.GetReplicationKey(e.Object); if(newReplicationKeyValue != replicationKeyValue) trackedObjects.SetPropertyOldValue(e.Object, replKeyMember.Name, newReplicationKeyValue); } } break; } }