Example #1
0
        /// <summary>
        /// Corrige l'état de la propriété de navigation Value.
        /// </summary>
        private void FixupValue(ActionValue previousValue)
        {
            if (IsDeserializing)
            {
                return;
            }

            if (previousValue != null && previousValue.ActionCategories.Contains(this))
            {
                previousValue.ActionCategories.Remove(this);
            }

            if (Value != null)
            {
                if (!Value.ActionCategories.Contains(this))
                {
                    Value.ActionCategories.Add(this);
                }

                ActionValueCode = Value.ActionValueCode;
            }
            if (ChangeTracker.ChangeTrackingEnabled)
            {
                ChangeTracker.RecordValue("Value", previousValue, Value);
                if (Value != null && !Value.ChangeTracker.ChangeTrackingEnabled)
                {
                    Value.StartTracking();
                }
            }
        }
Example #2
0
        /// <summary>
        /// Corrige l'état de la propriété de navigation ActionValue.
        /// </summary>
        private void FixupActionValue(ActionValue previousValue, bool skipKeys = false)
        {
            if (IsDeserializing)
            {
                return;
            }

            if (previousValue != null && previousValue.PublishedActionCategory.Contains(this))
            {
                previousValue.PublishedActionCategory.Remove(this);
            }

            if (ActionValue != null)
            {
                if (!ActionValue.PublishedActionCategory.Contains(this))
                {
                    ActionValue.PublishedActionCategory.Add(this);
                }

                ActionValueCode = ActionValue.ActionValueCode;
            }
            else if (!skipKeys)
            {
                ActionValueCode = null;
            }

            if (ChangeTracker.ChangeTrackingEnabled)
            {
                ChangeTracker.RecordValue("ActionValue", previousValue, ActionValue);
                if (ActionValue != null && !ActionValue.ChangeTracker.ChangeTrackingEnabled)
                {
                    ActionValue.StartTracking();
                }
            }
        }