Esempio n. 1
0
        /// <summary>
        /// Starts writing a single markup.
        /// </summary>
        /// <param name="markup"></param>
        public void EnterMarkup(MarkupType markup)
        {
            _jsonWriter.WriteStartArray();
            _jsonWriter.WriteValue(markup.Name);

            if (markup.Attributes.Any())
            {
                JsonTranslations.WriteAttributes(_jsonWriter, markup.Attributes);
            }
        }
        public void EnterSection(Section section)
        {
            var markupSection = (MarkupSection)section;

            _jsonWriter.WriteStartArray();

            _jsonWriter.WriteValue(SectionTypes.Markup);
            _jsonWriter.WriteValue(markupSection.TagName);

            JsonTranslations.WriteMarkers(_jsonWriter, markupSection.Markers);

            if (markupSection.Attributes.Any())
            {
                JsonTranslations.WriteAttributes(_jsonWriter, markupSection.Attributes);
            }
        }
Esempio n. 3
0
        /// <summary>
        /// Called before the section is processed.
        /// </summary>
        /// <param name="section"></param>
        public void EnterSection(Section section)
        {
            var listSection = (ListSection)section;

            _jsonWriter.WriteStartArray();

            _jsonWriter.WriteValue(SectionTypes.List);
            _jsonWriter.WriteValue(listSection.ListType);

            _jsonWriter.WriteStartArray();

            foreach (var markers in listSection.ListItems)
            {
                JsonTranslations.WriteMarkers(_jsonWriter, markers);
            }

            _jsonWriter.WriteEndArray();

            if (listSection.Attributes.Any())
            {
                JsonTranslations.WriteAttributes(_jsonWriter, listSection.Attributes);
            }
        }