Exemple #1
0
        /// <summary>
        /// Creates a text properties object using the specified writing system, old writing system, and a character
        /// style. The writing system value may be zero which means no writing system is specified. The style may be null.
        /// If the writing system is zero, then the old writing system must also be zero. An exception will be thrown otherwise.
        /// </summary>
        public ITsTextProps MakeProps(string bstrStyle, int ws, int ows)
        {
            ThrowIfWSInvalid("ws", ws);

            var intProps = new Dictionary <int, TsIntPropValue>
            {
                { (int)FwTextPropType.ktptWs, new TsIntPropValue(ows, ws) }
            };

            Dictionary <int, string> strProps = null;

            if (!string.IsNullOrEmpty(bstrStyle))
            {
                strProps = new Dictionary <int, string>
                {
                    { (int)FwTextPropType.ktptNamedStyle, bstrStyle }
                };
            }

            return(TsTextProps.GetInternedTextProps(intProps, strProps));
        }
Exemple #2
0
 internal TsString(string text, int ws)
     : this(text, TsTextProps.GetInternedTextProps(ws))
 {
 }
Exemple #3
0
 /// <summary>
 /// Creates an <see cref="ITsTextProps"/> from the current state. The number of TextProps may be less then
 /// the number pushed or inserted do to the compression of like, adjacent values.
 /// </summary>
 public ITsTextProps GetTextProps()
 {
     return(TsTextProps.GetInternedTextProps(IntProperties, StringProperties));
 }