ComputeNewVersion() public méthode

public ComputeNewVersion ( ) : VersionNumber
Résultat SenseNet.ContentRepository.Storage.VersionNumber
Exemple #1
0
        //==================================================== Versioning & Approving ====================================================

        private void VersionSetup()
        {
            if (this.Id == 0)
            {
                this.Version = SavingAction.ComputeNewVersion(this.HasApproving, this.VersioningMode);
            }
        }
Exemple #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);
        }