Exemple #1
0
        /// <summary>
        /// This is called when some property is changed so undo/redo works in that case
        /// </summary>
        /// <param name="item"></param>
        /// <param name="property"></param>
        /// <param name="newValue"></param>
        /// <param name="oldValue"></param>
        public void EditorItemUpdate(EditorItem item, string property, object oldValue, object newValue)
        {
            if (!Disabled)
            {
                EditorUpdateAction action = new EditorUpdateAction(item, property, oldValue, newValue);
                actions.Insert(currentActionIndex, action);
                currentActionIndex++;

                RemoveNotValidItems();
                EditorController.Instance.ProjectSaved = false;
            }
        }
Exemple #2
0
        /// <summary>
        /// group of properties is changed. This is used for example when locationx,y are changed
        /// </summary>
        /// <param name="item"></param>
        /// <param name="properties"></param>
        /// <param name="newValues"></param>
        /// <param name="oldValues"></param>
        public void EditorItemUpdate(EditorItem item, string[] properties, object[] oldValues, object[] newValues)
        {
            if (!Disabled)
            {
                EditorUpdateAction action = new EditorUpdateAction(item, properties, oldValues, newValues);
                actions.Insert(currentActionIndex, action);
                currentActionIndex++;

                RemoveNotValidItems();
                EditorController.Instance.ProjectSaved = false;
            }
        }