Welcome to mirror list, hosted at ThFree Co, Russian Federation.

TextElement.cs « SchemaObjectModel « EntityModel « Data « System « System.Data.Entity « referencesource « class « mcs - github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 914cb26e5a65116295678093a96a7888479a258d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
//---------------------------------------------------------------------
// <copyright file="TextElement.cs" company="Microsoft">
//      Copyright (c) Microsoft Corporation.  All rights reserved.
// </copyright>
//
// @owner       Microsoft
// @backupOwner Microsoft
//---------------------------------------------------------------------

using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace System.Data.EntityModel.SchemaObjectModel
{
    /// <summary>
    /// Summary description for Documentation.
    /// </summary>
    internal sealed class TextElement : SchemaElement
    {
        #region Instance Fields
        private string _value = null;
        #endregion

        #region Public Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="parentElement"></param>
        public TextElement(SchemaElement parentElement)
        : base(parentElement)
        {
        }
        #endregion

        #region Public Properties
        /// <summary>
        /// 
        /// </summary>
        public string Value
        {
            get
            {
                return _value;
            }
            private set
            {
                _value = value;
            }
        }
        #endregion

        #region Protected Properties
        protected override bool HandleText(XmlReader reader)
        {
            TextElementTextHandler(reader);
            return true;
        }
        #endregion

        #region Private Methods
        /// <summary>
        /// 
        /// </summary>
        /// <param name="reader"></param>
        private void TextElementTextHandler(XmlReader reader)
        {
            string text = reader.Value;
            if ( string.IsNullOrEmpty(text) )
                return;

            if ( string.IsNullOrEmpty(Value) )
                Value = text;
            else
                Value += text;
        }
        #endregion
    }
}