Exemplo n.º 1
0
        public void UndoCheckOut(bool forceRefresh = true)
        {
            NeedToSaveData = false;
            AssertValidAction(StateAction.UndoCheckOut);
            if (VersionHistory.Length == 1)
            {
                //-- there is only one version that is locked
                ExpectedVersion   = ComputeNewVersion();
                ExpectedVersionId = CurrentVersionId;
            }
            else
            {
                var lastNodeVersion = VersionHistory[VersionHistory.Length - 2];
                ExpectedVersion   = lastNodeVersion.VersionNumber;
                ExpectedVersionId = lastNodeVersion.VersionId;
            }

            //DeletableVersionIds.Add(this.Node.VersionId);
            var deletableNodeVersion = VersionHistory[VersionHistory.Length - 1];

            DeletableVersionIds.Add(deletableNodeVersion.VersionId);

            LockerUserId = 0;
            ForceRefresh = forceRefresh;
        }
Exemplo n.º 2
0
        public void UndoCheckOut(bool forceRefresh = true)
        {
            NeedToSaveData = false;
            AssertValidAction(StateAction.UndoCheckOut);
            if (VersionHistory.Length == 1)
            {
                // there is only one version that is locked
                throw new InvalidContentActionException(InvalidContentActionReason.UndoSingleVersion, this.Node.Path);
            }

            var lastNodeVersion = VersionHistory[VersionHistory.Length - 2];

            ExpectedVersion   = lastNodeVersion.VersionNumber;
            ExpectedVersionId = lastNodeVersion.VersionId;

            var deletableNodeVersion = VersionHistory[VersionHistory.Length - 1];

            DeletableVersionIds.Add(deletableNodeVersion.VersionId);

            LockerUserId = 0;
            ForceRefresh = forceRefresh;
        }