本文整理汇总了C#中TextNode类的典型用法代码示例。如果您正苦于以下问题:C# TextNode类的具体用法?C# TextNode怎么用?C# TextNode使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TextNode类属于命名空间,在下文中一共展示了TextNode类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AdjustUrlPath
private TextNode AdjustUrlPath(TextNode textValue)
{
if (Importer != null)
{
textValue.Value = Importer.AlterUrl(textValue.Value, ImportPaths);
}
return textValue;
}
示例2: TextButton
public TextButton(ButtonFrames frames, SpriteFont font, int textSize, string text)
: base(frames)
{
_text = new TextNode(font, textSize)
{
Text = text
};
Icon = _text;
}
示例3: Activate
// Given new text node
public void Activate(TextNode tn)
{
CurNode = tn;
Active = true;
WritingText = true;
Chat.text = "";
Name.text = CurNode.Name;
WritingIndex = 0;
}
示例4: Main
static void Main()
{
ImaginaryHost h = new ImaginaryHost();
TextNode t = new TextNode(h);
Node tn = (Node)t;
MemoryStream s = new MemoryStream();
h.SerializeTo(s);
s.Position = 0;
System.Windows.Forms.Application.Run();
}
示例5: Read
public Node Read(string xmlString)
{
Node node = null;
if (xmlString.Contains("?xml"))
{
node = new XmlDeclarationNode {Name = "Declaration", Value = xmlString};
}
else if (xmlString.Contains("<!--"))
{
node = new CommentNode {Name = "Comment", Value = xmlString.Substring(4, xmlString.Length - 7)};
}else if (xmlString.Contains("\\"))
{
node = new CommentNode {Name = "ScriptComment", Value = xmlString.Substring(2, xmlString.Length - 2)};
}
else if (xmlString.Contains("<Item>"))
{
node = new TextNode {Name = "Text", Value = xmlString.Substring(6, xmlString.Length - 13)};
}else if (xmlString.ToLower().Contains("<script>"))
{
node = new TextNode {Name = "script", Value = xmlString.Substring(8, xmlString.Length - 17)};
}
return node;
}
示例6: Url
public Url(TextNode value, IEnumerable<string> paths)
{
// The following block is commented out, because we want to have the path verbatim,
// not rewritten. Here's why: Say less/trilogy_base.less contains
//
// background-image: url(img/sprites.png)
//
// and serverfault/all.less contains
//
// @import "../less/trilogy_base"
//
// If relative paths where to be rewritten, the resulting serverfault/all.css would read
//
// background-image: url(../less/img/sprites.png)
//
// which is obviously not what we want.
/*if (!Regex.IsMatch(value.Value, @"^(http:\/)?\/") && paths.Any())
{
value.Value = paths.Concat(new[] {value.Value}).AggregatePaths();
}*/
Value = value;
}
示例7: SvgTitleElement
public SvgTitleElement(string s)
{
TextNode tn = new TextNode(s);
AddChild(tn);
}
示例8: BlockNode
public BlockNode(TextNode owner)
{
this.owner = owner;
}
示例9: VisitText
public virtual void VisitText(TextNode textNode)
{
VisitChildren(textNode);
}
示例10: VisitText
public void VisitText(TextNode textNode)
{
// unused
}
示例11: ConvertFromCSharp
public string ConvertFromCSharp(TextNode node)
{
var sb = new StringBuilder();
if (node.Text == "List")
{
sb.Append(ConvertFromCSharp(node.Children[0]));
sb.Append("[]");
}
else if (node.Text == "Dictionary")
{
sb.Append("{ [index:");
sb.Append(ConvertFromCSharp(node.Children[0]));
sb.Append("]: ");
sb.Append(ConvertFromCSharp(node.Children[1]));
sb.Append("; }");
}
else
{
sb.Append(TypeAlias(node.Text));
if (node.Children.Count > 0)
{
sb.Append("<");
for (var i = 0; i < node.Children.Count; i++)
{
var childNode = node.Children[i];
if (i > 0)
sb.Append(",");
sb.Append(ConvertFromCSharp(childNode));
}
sb.Append(">");
}
}
return sb.ToString();
}
示例12: AcceptNodePackage
/// <summary>
/// Add a string for the system to draw. Strings are drawn in a FIFO basis, so calling this method
/// does not guarantee the string will immediately begin drawing.
/// </summary>
/// <param name="str">String to draw</param>
/// <param name="delay">Optional param, to specify delay before the message is written</param>
public void AcceptNodePackage(TextNode.NodePackage package, bool skipCurrent = false)
{
if (skipCurrent) { SkipCurrentSequence(); }
toDisplay.Enqueue(package);
PackageAddedToQueue();
}
示例13: AdjustUrlPath
private TextNode AdjustUrlPath(TextNode textValue)
{
if (Importer != null && !Regex.IsMatch(textValue.Value, @"^(([a-zA-Z]+:)|(\/))"))
{
textValue.Value = Importer.AlterUrl(textValue.Value, ImportPaths);
}
return textValue;
}
示例14: AddChar
internal override GlobNode AddChar(char c)
{
var node = new TextNode(this);
nodes.Add(node);
return node.AddChar(c);
}
示例15: Add
public bool Add(TextNode textNode)
{
if(Contains(textNode.Text)) {
foreach (var child in Children) {
if (child.Add(textNode)) {
return true;
}
}
Children.Add(textNode);
return true;
}
return false;
}