ComputeNewVersion() 공개 메소드

public ComputeNewVersion ( ) : VersionNumber
리턴 SenseNet.ContentRepository.Storage.VersionNumber
예제 #1
0
        //==================================================== Versioning & Approving ====================================================

        private void VersionSetup()
        {
            if (this.Id == 0)
            {
                this.Version = SavingAction.ComputeNewVersion(this.HasApproving, this.VersioningMode);
            }
        }
예제 #2
0
        public static Node CreateFromTemplate(Node target, Node template, string name)
        {
            var           newNode = template.MakeTemplatedCopy(target, name);
            VersionNumber version = null;

            //compute new version number according to the versioning
            //and approving settings in the target folder
            var gc = newNode as GenericContent;

            if (gc != null)
            {
                version = SavingAction.ComputeNewVersion(gc.ApprovingMode == ApprovingType.True, gc.VersioningMode);
            }
            else
            {
                //TODO: handle non-GenericContent scenarios
            }

            if (version != null)
            {
                newNode.Version = version;
            }

            newNode.Template = template;

            return(newNode);
        }