SenseNet.ContentRepository.Tools.CreateContent C# (CSharp) 메소드

CreateContent() 개인적인 정적인 메소드

private static CreateContent ( string parentPath, string name, string typeName ) : Content
parentPath string
name string
typeName string
리턴 Content
        private static Content CreateContent(string parentPath, string name, string typeName)
        {
            if (string.IsNullOrEmpty(name))
                throw new ArgumentNullException("name");
            if (string.IsNullOrEmpty(typeName))
                throw new ArgumentNullException("typeName");

            var parent = Node.LoadNode(parentPath);

            if (parent == null)
                throw new ApplicationException("Parent does not exist: " + parentPath);

            //don't use admin account here, that should be 
            //done in the calling 'client' code if needed
            var content = Content.CreateNew(typeName, parent, name);
            content.Save();
            
            return content;
        }