Fix watchos tests for system.data (#6600)
[mono-project.git] / docs / HtmlAgilityPack / MixedCodeDocumentCodeFragment.cs
blobf74b2f3268e5665ecaf032ad2d9ce2e3cc1dab1b
1 // HtmlAgilityPack V1.0 - Simon Mourier <simon underscore mourier at hotmail dot com>
2 namespace HtmlAgilityPack
4 /// <summary>
5 /// Represents a fragment of code in a mixed code document.
6 /// </summary>
7 public class MixedCodeDocumentCodeFragment : MixedCodeDocumentFragment
9 #region Fields
11 private string _code;
13 #endregion
15 #region Constructors
17 internal MixedCodeDocumentCodeFragment(MixedCodeDocument doc)
19 base(doc, MixedCodeDocumentFragmentType.Code)
23 #endregion
25 #region Properties
27 /// <summary>
28 /// Gets the fragment code text.
29 /// </summary>
30 public string Code
32 get
34 if (_code == null)
36 _code = FragmentText.Substring(Doc.TokenCodeStart.Length,
37 FragmentText.Length - Doc.TokenCodeEnd.Length -
38 Doc.TokenCodeStart.Length - 1).Trim();
39 if (_code.StartsWith("="))
41 _code = Doc.TokenResponseWrite + _code.Substring(1, _code.Length - 1);
44 return _code;
46 set { _code = value; }
49 #endregion