Click here to Skip to main content
12,358,775 members (62,587 online)
Click here to Skip to main content

Tagged as

Stats

95.2K views
3.4K downloads
99 bookmarked
Posted

RTF Document Constructor Library

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

namespace ESCommon.Rtf
{
    internal enum RtfEnumConversion { UseName, UseValue, UseAttribute }

    /// <summary>
    /// Specifies a way to convert an enum to a control word.
    /// </summary>
    [AttributeUsage(AttributeTargets.Enum, AllowMultiple = false)]
    internal class RtfEnumAsControlWordAttribute : Attribute
    {
        private RtfEnumConversion _conversion = RtfEnumConversion.UseName;
        private string _prefix = String.Empty;

        /// <summary>
        /// Gets conversion type.
        /// </summary>
        internal RtfEnumConversion Conversion
        {
            get { return _conversion; }
        }

        /// <summary>
        /// Gets or sets a String value used as a prefix when converting an enum to control word.
        /// </summary>
        public string Prefix
        {
            get { return _prefix; }
            set { _prefix = value; }
        }

        /// <summary>
        /// Initializes a new instance of ESCommon.Rtf.RtfEnumAsControlWordAttribute class.
        /// </summary>
        /// <param name="conversion">Conversion type.</param>
        internal RtfEnumAsControlWordAttribute(RtfEnumConversion conversion)
        {
            _conversion = conversion;
        }
    }
}

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...

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