///<summary>Build a contents chunk, passing the contents string and specifying whether it comes from a Glyphs element.</summary> 
 ///<param name="contents">The value of the chunk's contents property.</param> 
 ///<param name="chunkID">An arbitrary Uint32 to identify each chunk returned by IFilter.GetChunk.</param>
 ///<param name="breakType">The opening break for the chunk.</param> 
 ///<param name="attribute">A description of the property represented by the chunk.</param>
 ///<param name="lcid">The locale ID for the chunk.</param>
 internal IndexingContentUnit(
     string contents, 
     uint chunkID,
     CHUNK_BREAKTYPE breakType, 
     ManagedFullPropSpec attribute, 
     uint lcid)
     : base(chunkID, breakType, attribute, lcid, CHUNKSTATE.CHUNK_TEXT) 
 {
     _contents = contents;
 }
 /// <summary>
 /// A utility to be used when one wants to reuse 
 /// one object to hold different values in succession. 
 /// </summary>
 internal void InitIndexingContentUnit( 
     string contents,
     uint chunkID,
     CHUNK_BREAKTYPE breakType,
     ManagedFullPropSpec attribute, 
     uint lcid)
 { 
     _contents = contents; 
     ID = chunkID;
     BreakType = breakType; 
     Attribute = attribute;
     Locale = lcid;
 }
Exemple #3
0
        ///<summary>Build a contents chunk, passing the contents string.</summary> 
        /// <param name="index">id</param>
        /// <param name="breakType">The opening break for the chunk.</param> 
        /// <param name="attribute">attribute</param>
        /// <param name="lcid">The locale ID for the chunk.</param>
        /// <param name="flags">Indicates if it is text or value chunk.</param>
        /// <remarks> 
        /// All the chunks returned by the XAML filter and the container filter are text chunks.
        /// Should a future filter implementation be capable of returning value chunks, a new constructor 
        /// and a Flags property will have to be defined. 
        /// </remarks>
        internal ManagedChunk(uint index, CHUNK_BREAKTYPE breakType, ManagedFullPropSpec attribute, uint lcid, CHUNKSTATE flags) 
        {
            // Argument errors can only be due to internal inconsistencies, since no input data makes its way here.
            Invariant.Assert(breakType >= CHUNK_BREAKTYPE.CHUNK_NO_BREAK && breakType <= CHUNK_BREAKTYPE.CHUNK_EOC);
            Invariant.Assert(attribute != null); 
            // Note that lcid values potentially cover the full range of uint values
            // (see http://msdn.microsoft.com/library/default.asp?url=/library/en-us/intl/nls_8sj7.asp) 
            // and so no useful validation can be made for lcid. 

            _index = index; 
            _breakType = breakType;
            _lcid = lcid;
            _attribute = attribute;
            _flags = flags; 

            // Since pseudo-properties (a.k.a. internal values) are not supported by the XPS filters, 
            // all chunks we return are expected to have idChunkSource equal to idChunk. 
            // (See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/indexsrv/html/ixufilt_8ib8.asp)
            _idChunkSource = _index; 

        }