示例#1
0
        /// <summary>
        /// Converts the current PageInfo to a string.
        /// </summary>
        /// <returns>The string.</returns>
        public override string ToString()
        {
            string result = NameTools.GetFullName(nspace, name);

            result += " [" + provider.Information.Name + "]";
            return(result);
        }
示例#2
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:PageInfo" /> class.
 /// </summary>
 /// <param name="fullName">The Full Name of the Page.</param>
 /// <param name="provider">The Pages Storage Provider that manages this Page.</param>
 /// <param name="creationDateTime">The Page creation Date/Time.</param>
 public PageInfo(string fullName, IPagesStorageProviderV30 provider, DateTime creationDateTime)
 {
     NameTools.ExpandFullName(fullName, out _nspace, out _name);
     FullName         = fullName;
     Provider         = provider;
     CreationDateTime = creationDateTime;
 }
示例#3
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="T:PageInfo" /> class.
 /// </summary>
 /// <param name="nspace">Namespace of the Page.</param>
 /// <param name="name">Name of the Page.</param>
 /// <param name="provider">The Pages Storage Provider that manages this Page.</param>
 /// <param name="creationDateTime">The Page creation Date/Time.</param>
 public PageInfo(string nspace, string name, IPagesStorageProviderV30 provider, DateTime creationDateTime)
 {
     _nspace          = nspace;
     _name            = name;
     FullName         = NameTools.GetFullName(nspace, name);
     Provider         = provider;
     CreationDateTime = creationDateTime;
 }
示例#4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:PageContent"/> class.
 /// </summary>
 /// <param name="pageFullName">The PageInfo object.</param>
 /// <param name="provider">The Pages Storage Provider that manages this Page.</param>
 /// <param name="creationDateTime">The Page creation Date/Time.</param>
 /// <param name="title">The Title.</param>
 /// <param name="user">The User that last modified the Page.</param>
 /// <param name="lastModified">The last modification Date and Time.</param>
 /// <param name="comment">The Comment of the editor, about this revision.</param>
 /// <param name="content">The <b>unparsed</b> Content.</param>
 /// <param name="keywords">The keywords, usually used for SEO, or <c>null</c>.</param>
 /// <param name="description">The description, usually used for SEO, or <c>null</c>.</param>
 public PageContent(string pageFullName, IPagesStorageProviderV60 provider, DateTime creationDateTime, string title, string user, DateTime lastModified, string comment, string content,
                    string[] keywords, string description)
 {
     this.nspace           = NameTools.GetNamespace(pageFullName);
     this.name             = NameTools.GetLocalName(pageFullName);
     this.provider         = provider;
     this.creationDateTime = creationDateTime;
     this.title            = title;
     this.user             = user;
     this.lastModified     = lastModified;
     this.content          = content;
     this.comment          = comment;
     this.keywords         = keywords != null ? keywords : new string[0];
     this.description      = description;
 }
示例#5
0
        /// <summary />
        public IEnumerable <PageInfo> ApplyOn(IEnumerable <PageInfo> list)
        {
            list = list.Where(p => NameTools.AreNamespaceEquals(NameTools.GetNamespace(p.FullName), Namespace));

            if (!string.IsNullOrEmpty(Name))
            {
                list = list.Where(p => MatchPattern(NameTools.GetLocalName(p.FullName), Name));
            }

            if (PageIndex > -1 && PageSize > -1)
            {
                list = list
                       .Skip(PageIndex * PageSize)
                       .Take(PageSize);
            }

            return(list);
        }
示例#6
0
 /// <summary>
 /// Initializes a new instance of the <b>NavigationPath</b> class.
 /// </summary>
 /// <param name="fullName">The Full Name of the Navigation Path.</param>
 /// <param name="provider">The Provider</param>
 public NavigationPath(string fullName, IPagesStorageProviderV30 provider)
 {
     NameTools.ExpandFullName(fullName, out nspace, out name);
     this.provider = provider;
     pages         = new string[0];
 }
示例#7
0
 /// <summary>
 /// Gets a string representation of the current object.
 /// </summary>
 /// <returns>The string representation.</returns>
 public override string ToString()
 {
     return(NameTools.GetFullName(nspace, name));
 }
示例#8
0
 /// <summary>
 /// Initializes a new instance of the <see cref="T:CategoryInfo" /> class.
 /// </summary>
 /// <param name="fullName">The Full Name of the Category.</param>
 /// <param name="provider">The Storage that manages the category.</param>
 public CategoryInfo(string fullName, IPagesStorageProviderV60 provider)
 {
     NameTools.ExpandFullName(fullName, out nspace, out name);
     this.provider = provider;
 }
示例#9
0
 /// <summary>
 /// Rename the page with the provided <paramref name="newFullName"/>.
 /// </summary>
 /// <param name="newFullName">New full name for the page.</param>
 public void Rename(string newFullName)
 {
     FullName = newFullName;
     NameTools.ExpandFullName(FullName, out _nspace, out _name);
 }