Пример #1
0
 private void InternalPropertyChangedHandler(object sender, ObjectChangeEventArgs e)
 {
     if (e.PropertyName == "Quantity")
     {
         GetDefaultSchedule().Qty = (int)e.NewValue;
     }
 }
Пример #2
0
 void ObjectDomainBase_Changed(object sender, ObjectChangeEventArgs e)
 {
     if (!string.IsNullOrEmpty(e.PropertyName))
     {
         needUpdate = true;
     }
 }
Пример #3
0
 private void Session_ObjectChanged(object sender, ObjectChangeEventArgs e)
 {
     if (e.Reason == ObjectChangeReason.PropertyChanged)
     {
         btnSave.Enabled = true;
     }
 }
Пример #4
0
 private void CurrentObjectOnChanged(object sender, ObjectChangeEventArgs objectChangeEventArgs)
 {
     if (objectChangeEventArgs.PropertyName == nameof(IXpoModelDifference.XmlContent))
     {
         _xmlContentChanged = true;
     }
 }
Пример #5
0
 protected override void TriggerObjectChanged(ObjectChangeEventArgs args)
 {
     if (!CancelTriggerObjectChanged)
     {
         base.TriggerObjectChanged(args);
     }
 }
Пример #6
0
 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;
     }
 }
Пример #8
0
 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;
             }
         }
     }
 }
Пример #9
0
        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();
 }
Пример #11
0
            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;
            }
Пример #12
0
 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;
     }
 }
Пример #13
0
 protected override void TriggerObjectChanged(ObjectChangeEventArgs args)
 {
     XPBaseObject.RaiseChangedEvent(this, args);
     if (IsInvalidated)
     {
         return;
     }
     base.TriggerObjectChanged(args);
 }
Пример #14
0
 void CurrentObjectOnChanged(object sender, ObjectChangeEventArgs objectChangeEventArgs)
 {
     if (objectChangeEventArgs.PropertyName == "XmlContent")
     {
         var aspect = _masterModel.CurrentAspect;
         _masterModel = _modelLoader.GetMasterModel(false);
         CreateModelEditorController(aspect);
     }
 }
Пример #15
0
 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);
     }
 }
Пример #16
0
 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);
     }
 }
Пример #17
0
 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);
 }
Пример #18
0
 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);
 }
Пример #20
0
 static void UnitOfWorkObjectChanged(object sender, ObjectChangeEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine("UnitOfWorkObjectChanged()");
 }
Пример #21
0
 //
 public void OnCurrentPaymentChanged(object sender, ObjectChangeEventArgs e)
 {
     OnChanged("CurrentPayment");
 }
Пример #22
0
 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);
     }
 }
Пример #23
0
 private static void XPBaseObjectChanged(object sender, ObjectChangeEventArgs e)
 {
     System.Diagnostics.Debug.WriteLine("XPBaseObject: OnChanged");
 }
Пример #24
0
 void OnCustomerObjectChange(object sender, ObjectChangeEventArgs e)
 {
     this.RaiseCanExecuteChanged(x => x.Save());
 }
Пример #25
0
 protected override void TriggerObjectChanged(ObjectChangeEventArgs args) {
     if (!CancelTriggerObjectChanged)
         base.TriggerObjectChanged(args);
 }
Пример #26
0
 void CurrentObjectOnChanged(object sender, ObjectChangeEventArgs objectChangeEventArgs) {
     if (objectChangeEventArgs.PropertyName == "XmlContent") {
         var aspect = _masterModel.CurrentAspect;
         _masterModel = _modelLoader.GetMasterModel(true);
         _controller = GetModelEditorController(aspect);
     }
 }
Пример #27
0
        /// <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;
            }
        }
Пример #28
0
 void OnVideoRentObjectChanged(object sender, ObjectChangeEventArgs e)
 {
     RaiseChanged();
 }
 protected void OnCurrentObjectChanged(object sender, ObjectChangeEventArgs e)
 {
     MessageBox.Show("aaa");
 }
Пример #30
0
 private void Flow_Changed(object sender, ObjectChangeEventArgs e)
 {
     if (e.PropertyName == "IsDesignMode")
     {
         UpdateDesignerMode((bool)e.NewValue);
     }
 }
Пример #31
0
 // TODO: move logic to view controller
 private void CashFlow_Changed(object sender, ObjectChangeEventArgs e)
 {
     if (!this.IsLoading)
     {
     }
 }
Пример #32
0
        /// <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;
            }
        }