示例#1
0
        public StartInlineMarkerSpec(string marker, string markerMap, string dataMap,
			string replaceMarker, EndInlineMarkerSpec end)
            : base(marker, markerMap, dataMap, replaceMarker)
        {
            m_end = end;
        }
示例#2
0
        /// <summary>
        /// A Factory method to create the correct type of MarkerSpec object.
        /// </summary>
        /// <param name="marker"></param>
        /// <param name="markerMap"></param>
        /// <param name="dataMap"></param>
        /// <param name="isInline"></param>
        /// <param name="replaceMarker"></param>
        /// <param name="end"></param>
        /// <param name="endReplaceMarker"></param>
        /// <returns></returns>
        public static MarkerSpec CreateMarkerSpec(string marker, string markerMap, string dataMap,
			bool isInline, string replaceMarker, string end, string endReplaceMarker)
        {
            MarkerSpec ms;

            if (isInline)
            {
                // check to see if there is an end marker specified
                if (end == null || end.Length == 0)
                {
                    // create an AloneInlineMarkerSpec
                    ms = new AloneInlineMarkerSpec(marker, markerMap, replaceMarker);
                }
                else
                {
                    // create a StartInlineMarkerSpec with a EndInlineMarkerSpec
                    EndInlineMarkerSpec endMs;

                    endMs = new EndInlineMarkerSpec(end, markerMap, endReplaceMarker);
                    ms = new StartInlineMarkerSpec(marker, markerMap, dataMap, replaceMarker, endMs);
                }
            }
            else
            {
                // create an FieldMarkerSpec
                ms = new FieldMarkerSpec(marker, markerMap, dataMap, replaceMarker);
            }
            return ms;
        }