public bool MergeWith(ITransactionItem other)
            {
                PropertyChangeAction o = other as PropertyChangeAction;

                if (o != null && property._property == o.property._property)
                {
                    newIsSet = o.newIsSet;
                    newValue = o.newValue;
                    return(true);
                }
                return(false);
            }
        private PropertyChangeAction ToPropertyChangeAction(XmlPropertyChangeAction propertyChangeAction, int currentUserId)
        {
            if (propertyChangeAction.UsersGroups != null)
            {
                return(ToPropertyChangeUserGroupAction(propertyChangeAction, currentUserId));
            }
            else
            {
                var action = new PropertyChangeAction
                {
                    InstancePropertyTypeId = propertyChangeAction.PropertyTypeId,
                    PropertyValue          = propertyChangeAction.PropertyValue,
                };
                if (propertyChangeAction.ValidValues.Any())
                {
                    action.ValidValues.AddRange(propertyChangeAction.ValidValues);
                }

                return(action);
            }
        }
Example #3
0
        /// <summary>
        /// Visits the value difference.
        /// </summary>
        /// <param name="difference">The difference.</param>
        /// <returns>
        /// A sequence of actions that must be performed to upgrade
        /// from <see cref="IDifference.Source"/> of the specified
        /// difference to its <see cref="IDifference.Target"/>.
        /// </returns>
        protected virtual void VisitValueDifference(ValueDifference difference)
        {
            if (Stage != UpgradeStage.Upgrade)
            {
                return;
            }

            var parentContext = Context.Parent;
            var targetNode    = ((NodeDifference)parentContext.Difference).Target;

            if (targetNode == null)
            {
                return;
            }

            var action = new PropertyChangeAction {
                Path = targetNode.Path
            };

            action.Properties.Add(parentContext.Property, PathNodeReference.Get(difference.Target));
            AddAction(UpgradeActionType.PostCondition, action);
        }
 private static bool IsTypeChangeAction(PropertyChangeAction action)
 {
     return(action.Properties.ContainsKey("Type") &&
            action.Difference.Parent.Source is StorageColumnInfo &&
            action.Difference.Parent.Target is StorageColumnInfo);
 }
        public void PropertyChange(CustomClass currentObject, object oldValue, string propertyName)
        {
            var action = new PropertyChangeAction(currentObject, oldValue, propertyName);

            HandlePushAction(action, false);
        }