Click here to Skip to main content
13,054,779 members (65,299 online)
Click here to Skip to main content

Stats

114.2K views
3.8K downloads
101 bookmarked
Posted 30 Jul 2010

RTF Document Constructor Library

, 16 Aug 2010
Create Rich Text Format documents programatically.
using System;
using System.Collections.Generic;
using System.Text;

namespace ESCommon.Rtf
{
    internal enum RtfTextDataType { Text, HyperLink, Raw }
    
    /// <summary>
    /// Specifies text data.
    /// </summary>
    [AttributeUsage(AttributeTargets.Property | AttributeTargets.Field, AllowMultiple = false)]
    internal class RtfTextDataAttribute : Attribute
    {
        private RtfTextDataType _type = RtfTextDataType.Text;
        private bool quotes = false;
        
        /// <summary>
        /// Gets or sets a Boolean value indicating whether RtfWriter should enclose text with quotes.
        /// </summary>
        public bool Quotes
        {
            get { return quotes; }
            set { quotes = value; }
        }

        /// <summary>
        /// Gets text data type.
        /// </summary>
        public RtfTextDataType TextDataType
        {
            get { return _type; }
        }

        /// <summary>
        /// Initializes a new instance of ESCommon.Rtf.RtfTextDataAttribute class.
        /// </summary>
        internal RtfTextDataAttribute()
        {
        }

        /// <summary>
        /// Initializes a new instance of ESCommon.Rtf.RtfTextDataAttribute class.
        /// </summary>
        /// <param name="type">Text data type.</param>
        internal RtfTextDataAttribute(RtfTextDataType type)
        {
            _type = type;
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Dima Popov
Software Developer Energoservice
Russian Federation Russian Federation
Dmitry lives in Arkhangelsk, Russia. He has developed C# applications since 2007.

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 16 Aug 2010
Article Copyright 2010 by Dima Popov
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid