Пример #1
0
		public void Build(Object buildingElement, ref Grid buildingSpace)
		{
			TextTag = buildingElement as Text;
			var control = new TextBox();
			control.Text = TextTag.Value;
			control.TextWrapping = TextWrapping.Wrap;
			control.AcceptsReturn = true;
			Grid.SetRow(control, (buildingSpace as Grid).RowDefinitions.Count);
			buildingSpace.Children.Add(control);
			(buildingSpace as Grid).RowDefinitions.Add(new RowDefinition());
		}
Пример #2
0
 void EndData(Text containerClass)
 {
     if (currentData.Count > 0)
     {
         string data = currentData.Aggregate(new StringBuilder(), (x, y) => x.Append(y)).ToString();
         
         char[] spaceChars = { (char)9, (char)10, (char)12, (char)13, (char)32 };
         if (string.IsNullOrEmpty(new string(data.Where(c => !spaceChars.Contains(c)).ToArray())))
         {
             if (preserveWhitespaceTags.Intersect(TagStack.Select(tag => tag.TagName)).Count() == 0)
             {
                 if (data.Contains("\n"))
                 {
                     data = "\n";
                 }
                 else
                 {
                     data = " ";
                 }
             }
         }
         currentData = new List<string>();
         Text o = containerClass;
         o.Value = data;
         o.Setup(currentTag, Root.Previous);
         if (Root.Previous != null)
         {
             Root.Previous.Next = o;
         }
         Root.Previous = o;
         currentTag.AddChild(o);
     }
 }
Пример #3
0
 void ToStringSubClass(string text, Text p)
 {
     EndData();
     HandleData(text);
     EndData(p);
 }