Create() public static method

public static Create ( Node node ) : SavingAction
node Node
return SavingAction
示例#1
0
        public virtual void Reject()
        {
            var action = SavingAction.Create(this);

            action.Reject();
            action.Execute();
        }
示例#2
0
        public virtual void Publish()
        {
            var action = SavingAction.Create(this);

            action.Publish();
            action.Execute();
        }
示例#3
0
        public virtual void Approve()
        {
            var action = SavingAction.Create(this);

            action.Approve();
            action.Execute();
        }
示例#4
0
        public virtual void CheckIn()
        {
            var action = SavingAction.Create(this);

            action.CheckIn();
            action.Execute();
        }
示例#5
0
        public void UndoCheckOut(bool forceRefresh = true)
        {
            var action = SavingAction.Create(this);

            action.UndoCheckOut(forceRefresh);
            action.Execute();
        }
示例#6
0
        public virtual void SaveSameVersion()
        {
            var action = SavingAction.Create(this);

            action.SaveSameVersion();
            action.Execute();
        }
示例#7
0
        public static bool HasUndoCheckOut(GenericContent node)
        {
            if (HasForceUndoCheckOutRight(node))
            {
                return(false);
            }

            var s = SavingAction.Create(node);

            return(s.ValidateAction(StateAction.UndoCheckOut) == ActionValidationResult.Valid);
        }
示例#8
0
        public virtual void Save(SavingMode mode)
        {
            var action = SavingAction.Create(this);

            switch (mode)
            {
            case SavingMode.RaiseVersion:
                action.CheckOutAndSaveAndCheckIn();
                break;

            case SavingMode.RaiseVersionAndLock:
                action.CheckOutAndSave();
                break;

            case SavingMode.KeepVersion:
                action.SaveSameVersion();
                break;

            default:
                throw new NotImplementedException("Unknown SavingMode: " + mode);
            }
            action.Execute();
        }
示例#9
0
        public static bool HasReject(GenericContent node)
        {
            var s = SavingAction.Create(node);

            return(s.ValidateAction(StateAction.Reject) == ActionValidationResult.Valid);
        }
示例#10
0
        public static bool HasCheckIn(Node node)
        {
            var s = SavingAction.Create(node);

            return(s.ValidateAction(StateAction.CheckIn) == ActionValidationResult.Valid);
        }