public static FocusUndoer CommitUmlOperationFocus(IFocus focus, object model, object value, bool isRedo, out bool isCancelled)
        {
            var ope = (UmlOperation)model;

            var oldName       = ope.Name;
            var oldVisibility = ope.Visibility;
            var oldParams     = ope.Parameters;
            var oldTypeName   = ope.TypeName;

            var strs     = ((StyledText)value).Lines;
            var newValue = strs.Any() ? strs[0] : "";

            string newVisibilityText, newName, newParams, newTypeName;

            isCancelled = !UmlTextUtil.ParseUmlOperation(newValue, out newVisibilityText, out newName, out newParams, out newTypeName);
            if (isCancelled)
            {
                return(null);
            }
            var newVisibility = UmlTextUtil.GetVisibility(newVisibilityText);

            if (newName == oldName && newVisibility == oldVisibility && newParams == oldParams && newTypeName == oldTypeName)
            {
                return(null);
            }
            else
            {
                ope.Name       = newName;
                ope.Visibility = UmlTextUtil.GetVisibility(newVisibilityText);
                ope.Parameters = newParams;
                ope.TypeName   = newTypeName;
                return((f, m) => {
                    var o = (UmlOperation)m;
                    o.Name = oldName;
                    o.Visibility = oldVisibility;
                    o.Parameters = oldParams;
                    o.TypeName = oldTypeName;
                });
            }
        }
        public static FocusUndoer CommitUmlPropertyFocus(IFocus focus, object model, object value, bool isRedo, out bool isCancelled)
        {
            var prop          = (UmlProperty)model;
            var oldName       = prop.Name;
            var oldVisibility = prop.Visibility;
            var oldTypeName   = prop.TypeName;

            var strs     = ((StyledText)value).Lines;
            var newValue = strs.Any() ? strs[0] : "";

            string newVisibilityText, newName, newTypeName;

            isCancelled = !UmlTextUtil.ParseUmlProperty(newValue, out newVisibilityText, out newName, out newTypeName);
            if (isCancelled)
            {
                return(null);
            }
            var newVisibility = UmlTextUtil.GetVisibility(newVisibilityText);

            if (newName == oldName && newVisibility == oldVisibility && newTypeName == oldTypeName)
            {
                return(null);
            }
            else
            {
                prop.Name       = newName;
                prop.Visibility = UmlTextUtil.GetVisibility(newVisibilityText);
                prop.TypeName   = newTypeName;

                return((f, m) => {
                    var p = (UmlProperty)m;
                    p.Name = oldName;
                    p.Visibility = oldVisibility;
                    p.TypeName = oldTypeName;
                });
            }
        }