Inheritance: System.Windows.Controls.Panel
Ejemplo n.º 1
0
        private static Inline BuildParam(ElementToken token, Hint hint)
        {
            var pp = new ParamPanel();

            foreach (ParseToken pt in token.Tokens)
            {
                var et = pt as ElementToken;
                if (et != null)
                {
                    var tb = new TextBlock().Fill(et, hint);
                    pp.Children.Add(tb);
                    if (et.Name == "pname")
                    {
                        ParamPanel.SetNameColumn(tb, true);
                    }

                    continue;
                }

                var tt = pt as TextToken;
                if (tt != null && pp.Children.Count > 0)
                {
                    var elem = pp.Children[pp.Children.Count - 1] as TextBlock;
                    if (elem != null)
                    {
                        elem.Inlines.Add(GetInline(tt, hint));
                    }

                    continue;
                }
            }

            var span = new Span();

            span.Inlines.Add(new SoftBreak());
            span.Inlines.Add(new InlineUIContainer
            {
                Child             = pp,
                BaselineAlignment = BaselineAlignment.Bottom
            });
            span.Inlines.Add(new SoftBreak());
            return(span);
        }
Ejemplo n.º 2
0
        private static Inline BuildParam(ElementToken token, Hint hint)
        {
            var pp = new ParamPanel();
              foreach (ParseToken pt in token.Tokens)
              {
            var et = pt as ElementToken;
            if (et != null)
            {
              var tb = new TextBlock().Fill(et, hint);
              pp.Children.Add(tb);
              if (et.Name == "pname")
            ParamPanel.SetNameColumn(tb, true);

              continue;
            }

            var tt = pt as TextToken;
            if (tt != null && pp.Children.Count > 0)
            {
              var elem = pp.Children[pp.Children.Count - 1] as TextBlock;
              if (elem != null)
            elem.Inlines.Add(GetInline(tt, hint));

              continue;
            }
              }

              var span = new Span();
              span.Inlines.Add(new SoftBreak());
              span.Inlines.Add(new InlineUIContainer
                       {
                         Child = pp,
                         BaselineAlignment = BaselineAlignment.Bottom
                       });
              span.Inlines.Add(new SoftBreak());
              return span;
        }