Exemplo n.º 1
0
        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="contentFile">The content file from the project</param>
        /// <exception cref="ArgumentNullException">This is thrown if the content file is null</exception>
        public TopicFile(ContentFile contentFile)
        {
            if (contentFile == null)
            {
                throw new ArgumentNullException("contentFile");
            }

            this.contentFile = contentFile;

            revision = 1;
        }
Exemplo n.º 2
0
        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="contentFile">The content file from the project</param>
        /// <exception cref="ArgumentNullException">This is thrown if the content file is null</exception>
        public TopicFile(ContentFile contentFile)
        {
            if(contentFile == null)
                throw new ArgumentNullException("contentFile");

            this.contentFile = contentFile;

            revision = 1;
        }
Exemplo n.º 3
0
        //=====================================================================

        /// <inheritdoc />
        public IEnumerable<ContentFile> ContentFiles(BuildAction buildAction)
        {
            ContentFile contentFile;
            string metadata;
            int sortOrder;

            foreach(ProjectItem item in msBuildProject.GetItems(buildAction.ToString()))
            {
                contentFile = new ContentFile(new FilePath(item.EvaluatedInclude, this)) { ContentFileProvider = this };

                metadata = item.GetMetadataValue(BuildItemMetadata.LinkPath);

                if(!String.IsNullOrWhiteSpace(metadata))
                    contentFile.LinkPath = new FilePath(metadata, this);

                metadata = item.GetMetadataValue(BuildItemMetadata.SortOrder);

                if(!String.IsNullOrWhiteSpace(metadata) && Int32.TryParse(metadata, out sortOrder))
                    contentFile.SortOrder = sortOrder;

                yield return contentFile;
            }
        }
Exemplo n.º 4
0
        //=====================================================================

        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="contentLayoutFile">The content layout file associated with the collection</param>
        /// <remarks>Topics are not loaded until the <see cref="Load" /> method is called.  If the <c>file</c>
        /// parameter is null, this is assumed to be a child topic collection.</remarks>
        public TopicCollection(ContentFile contentLayoutFile)
        {
            this.contentLayoutFile = contentLayoutFile;
        }
Exemplo n.º 5
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="siteMapFile">The site map file associated with the collection</param>
 public TocEntryCollection(ContentFile siteMapFile)
 {
     this.siteMapFile = siteMapFile;
 }