Example #1
0
        /// <summary>
        ///   Initializes a new instance of the <see cref="WikiPage" /> class.
        /// </summary>
        /// <param name="parent"> Parent page. </param>
        /// <param name="pagePath"> Absolute path from wiki root. </param>
        /// <param name="title"> Page title. </param>
        /// <param name="template"> Template to use for child pages (if any). </param>
        public WikiPage(WikiPage parent, PagePath pagePath, string title, PageTemplate template)
        {
            if (pagePath == null) throw new ArgumentNullException("pagePath");
            if (title == null) throw new ArgumentNullException("title");

            Parent = parent;
            PagePath = pagePath;
            Title = title;
            CreatedBy = WikiContext.Current.User;
            CreatedAt = DateTime.Now;
            UpdatedAt = DateTime.Now;
            ChildTemplate = template;
            _backReferences = new List<WikiPage>();
        }
 public PageTemplate Create(string title, string contents)
 {
     var template = new PageTemplate(title, contents);
     _session.Save(template);
     return template;
 }