You've already forked linux-packaging-mono
Imported Upstream version 4.6.0.125
Former-commit-id: a2155e9bd80020e49e72e86c44da02a8ac0e57a4
This commit is contained in:
parent
a569aebcfd
commit
e79aa3c0ed
@ -0,0 +1,66 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <copyright file="StringPropertyBuilder.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.Web.UI {
|
||||
using System;
|
||||
using System.Collections;
|
||||
|
||||
/// <devdoc>
|
||||
/// Builds inner string properties.
|
||||
/// </devdoc>
|
||||
internal sealed class StringPropertyBuilder : ControlBuilder {
|
||||
private string _text;
|
||||
|
||||
|
||||
/// <devdoc>
|
||||
/// Creates a new instance of StringPropertyBuilder.
|
||||
/// </devdoc>
|
||||
internal StringPropertyBuilder() {
|
||||
}
|
||||
|
||||
internal StringPropertyBuilder(string text) {
|
||||
_text = text;
|
||||
}
|
||||
|
||||
/// <devdoc>
|
||||
/// Returns the inner text of the property.
|
||||
/// </devdoc>
|
||||
public string Text {
|
||||
get {
|
||||
return (_text == null) ? String.Empty : _text;
|
||||
}
|
||||
}
|
||||
|
||||
/// <devdoc>
|
||||
/// Gets the inner text of the property.
|
||||
/// </devdoc>
|
||||
public override void AppendLiteralString(string s) {
|
||||
if (ParentBuilder != null && ParentBuilder.HtmlDecodeLiterals())
|
||||
s = HttpUtility.HtmlDecode(s);
|
||||
|
||||
_text = s;
|
||||
}
|
||||
|
||||
/// <devdoc>
|
||||
/// Throws an exception - string properties cannot contain other objects.
|
||||
/// </devdoc>
|
||||
public override void AppendSubBuilder(ControlBuilder subBuilder) {
|
||||
throw new HttpException(SR.GetString(SR.StringPropertyBuilder_CannotHaveChildObjects, TagName, (ParentBuilder != null ? ParentBuilder.TagName : String.Empty)));
|
||||
}
|
||||
|
||||
public override object BuildObject() {
|
||||
return Text;
|
||||
}
|
||||
|
||||
public override void Init(TemplateParser parser, ControlBuilder parentBuilder,
|
||||
Type type, string tagName, string ID, IDictionary attribs) {
|
||||
|
||||
base.Init(parser, parentBuilder, type /*type*/, tagName, ID, attribs);
|
||||
|
||||
SetControlType(typeof(string));
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user