当前位置: 首页>>代码示例>>C#>>正文


C# TextBox.AppendTextLine方法代码示例

本文整理汇总了C#中System.Windows.Controls.TextBox.AppendTextLine方法的典型用法代码示例。如果您正苦于以下问题:C# TextBox.AppendTextLine方法的具体用法?C# TextBox.AppendTextLine怎么用?C# TextBox.AppendTextLine使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在System.Windows.Controls.TextBox的用法示例。


在下文中一共展示了TextBox.AppendTextLine方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MyCanvas

		public MyCanvas()
		{
			Width = DefaultWidth;
			Height = DefaultHeight;

			Colors.White.ToGradient(Colors.Gray, DefaultHeight / 4).Select(
				(c, i) =>
					new Rectangle
					{
						Fill = new SolidColorBrush(c),
						Width = DefaultWidth,
						Height = 4,
					}.MoveTo(0, i * 4).AttachTo(this)
			).ToArray();

			var t = new TextBox
			{
				AcceptsReturn = true,
				Text = "powered by jsc",
				BorderThickness = new Thickness(0),
				Foreground = Brushes.Black,
				Background = Brushes.White,
				IsReadOnly = true,
				Width = 300,
				Height = 300
			}.MoveTo(32, 32).AttachTo(this);

			var m = new MemoryStream();
			var w = new BinaryWriter(m);

			w.Write((byte)6);
			w.Write((short)7);
			w.Write((int)8);
			w.Write("hey Ԉ \ufffc \u00ff \u0100");

			t.AppendTextLine();

			foreach (var v in m.ToArray())
			{
				t.AppendText(v + " ");
			}

			m.Position = 0;

			var r = new BinaryReader(m);

			t.AppendTextLine();
			t.AppendTextLine("bytes: " + r.BaseStream.Length);
			t.AppendTextLine("byte " + r.ReadByte());
			t.AppendTextLine("short " + r.ReadInt16());
			t.AppendTextLine("int " + r.ReadInt32());
			t.AppendTextLine("string " + r.ReadString());
		}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:53,代码来源:MyCanvas.cs

示例2: ApplicationCanvas

        public ApplicationCanvas()
        {
            r.Fill = Brushes.Red;
            r.AttachTo(this);
            r.MoveTo(8, 8);
            this.SizeChanged += (s, e) => r.SizeTo(this.Width - 16.0, this.Height - 16.0);

            var Options = new Dictionary<Type, Func<int>>
			{
				{ typeof(Canvas), 
					() => 78
				},
				{ typeof(ApplicationCanvas), 
					() => 88
				}
            };

            var t = new TextBox { AcceptsReturn = true, IsReadOnly = true }.AttachTo(this);

            t.AppendTextLine(new { First = new { Options.First().Key.Name } }.ToString());
            t.AppendTextLine(new { Last = new { Options.Last().Key.Name } }.ToString());

            t.AppendTextLine(new { FirstKey = new { Options.Keys.First().Name } }.ToString());
            t.AppendTextLine(new { LastKey = new { Options.Keys.Last().Name } }.ToString());


            Options
                //.ForEach(
               .Select(Option => new { Option.Key, Option.Value })
               .WithEachIndex(
               (Option, Index) =>
               {
                   t.AppendTextLine(new { Option.Key.Name }.ToString());

               }
           );
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:37,代码来源:ApplicationCanvas.cs

示例3: ApplicationCanvas

        public ApplicationCanvas()
        {
            r.Fill = Brushes.Red;
            r.AttachTo(this);
            r.MoveTo(8, 8);
            this.SizeChanged += (s, e) => r.SizeTo(this.Width - 16.0, this.Height - 16.0);

            var t = new TextBox
            {
                AcceptsReturn = true,
                IsReadOnly = true,
            }.AttachTo(this);

            t.AppendTextLine("hello world");

            var foo = new MyDynamic { WriteLine = t.AppendTextLine };
            dynamic bar = foo;

            bar.foo = "foo";

            var goo = bar.goo;

            t.AppendTextLine(new { goo }.ToString());
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:24,代码来源:ApplicationCanvas.cs

示例4: AvalonBetrisCanvas

        public AvalonBetrisCanvas()
        {
            Width = DefaultWidth;
            Height = DefaultHeight;

            this.ClipToBounds = true;

            Colors.Blue.ToGradient(Colors.White, DefaultHeight / 4).Select(
                (c, i) =>
                    new Rectangle
                    {
                        Fill = new SolidColorBrush(c),
                        Width = DefaultWidth,
                        Height = 4,
                    }.MoveTo(0, i * 4).AttachTo(this)
            ).ToArray();

            var t = new TextBox
            {
                FontSize = 10,
                Text = "powered by jsc",
                BorderThickness = new Thickness(0),
                Foreground = 0xffffffff.ToSolidColorBrush(),
                Background = Brushes.Transparent,
                IsReadOnly = true,
                Width = DefaultWidth
            }.MoveTo(8, 8).AttachTo(this);

            var t2 = new TextBox
            {
                FontSize = 10,
                AcceptsReturn = true,
                Text = @"
            BETRIS
            ",
                BorderThickness = new Thickness(0),
                Foreground = 0xffffffff.ToSolidColorBrush(),
                Background = Brushes.Transparent,
                IsReadOnly = true,
                Width = DefaultWidth,
                Height = 128,
            }.MoveTo(8, 32).AttachTo(this);

            var bg = new Image
            {
                Source = ("assets/AvalonBetris/building_block_tetris.png").ToSource()
            }.MoveTo(0, 0).AttachTo(this);

            var img = new Image
            {
                Source = ("assets/AvalonBetris/jsc.png").ToSource()
            }.MoveTo(DefaultWidth - 128, DefaultHeight - 128).AttachTo(this);

            bg.MouseLeftButtonUp +=
                (sender, args) =>
                {
                    var p = args.GetPosition(this);
                    t2.AppendTextLine(new { p.X, p.Y }.ToString());
                };

            //help.Opacity = 1;
            img.Opacity = 0.5;

            var aw = 49;
            var ah = 49;

            var tri = new Image
            {
                Width = aw,
                Height = ah,
                Source = "assets/AvalonBetris/_19a.png".ToSource()
            }.AttachTo(this);

            var trig = new Image
            {
                Width = aw,
                Height = ah,
                Source = "assets/AvalonBetris/_19b.png".ToSource()
            }.AttachTo(this);

            var tri2 = new Image
            {
                Width = aw,
                Height = ah,
                Source = "assets/AvalonBetris/_18a.png".ToSource()
            }.AttachTo(this);

            var trig2 = new Image
            {
                Width = aw,
                Height = ah,
                Source = "assets/AvalonBetris/_18b.png".ToSource()
            }.AttachTo(this);

            // cursor position calculations are not ready
            // for transofrmed elements.
            // we will provide a floor for those events...
            var shadow = new Rectangle
            {
                Width = DefaultWidth,
//.........这里部分代码省略.........
开发者ID:BGCX261,项目名称:zproxygames-svn-to-git,代码行数:101,代码来源:AvalonBetrisCanvas.cs

示例5: TileFieldTest


//.........这里部分代码省略.........
            {

                var pipe = new Pipe.TopToLeft();

                pipe.Container.MoveTo(field_x + Tile.ShadowBorder + Tile.Size * 7, field_y + Tile.ShadowBorder + 52 * 4 - 12).AttachTo(this);

                pipe.Water.ForEach(
                    i => WaterFlow.Enqueue(() => i.Visibility = Visibility.Visible)
                );

            }

            Enumerable.Range(0, 3).ForEach(
                ix_ =>
                {
                    var ix = 6 - ix_;

                    var pipe = new Pipe.LeftToRight();

                    pipe.Container.MoveTo(field_x + Tile.ShadowBorder + Tile.Size * ix, field_y + Tile.ShadowBorder + 52 * 4 - 12).AttachTo(this);

                    pipe.Water.ForEachReversed(
                        i => WaterFlow.Enqueue(() => i.Visibility = Visibility.Visible)
                    );

                }
            );

            {

                var pipe = new Pipe.RightToDrain();

                pipe.Container.MoveTo(field_x + Tile.ShadowBorder + Tile.Size * 3, field_y + Tile.ShadowBorder + 52 * 4 - 12).AttachTo(this);

                pipe.Water.ForEach(
                    i => WaterFlow.Enqueue(() => i.Visibility = Visibility.Visible)
                );

            }
            #endregion

            field[3, 4].Drain.Visibility = Visibility.Visible;

            OverlayCanvas.AttachTo(this).MoveTo(0, 0);

            var Navigationbar = new AeroNavigationBar();

            Navigationbar.Container.MoveTo(4, 4).AttachTo(this);

            var c1 = new ArrowCursorControl
            {

            };

            c1.Container.MoveTo(32, 32).AttachTo(this);
            c1.Red.Opacity = 0.7;

            OverlayCanvas.MouseMove +=
                (sender, e) =>
                {
                    var p = e.GetPosition(OverlayCanvas);

                    c1.Container.MoveTo(32 + p.X, 32 + p.Y);
                };

            OverlayCanvas.MouseLeave +=
                delegate
                {
                    c1.Container.Visibility = Visibility.Hidden;
                };

            OverlayCanvas.MouseEnter +=
                delegate
                {
                    c1.Container.Visibility = Visibility.Visible;
                };

            foreach (var n in KnownAssets.Default.FileNames)
            {
                t.AppendTextLine(n);
            }

            3000.AtDelay(
                delegate
                {
                    (1000 / 10).AtIntervalWithTimer(
                        ttt =>
                        {
                            if (WaterFlow.Count == 0)
                            {
                                ttt.Stop();
                                return;
                            }

                            WaterFlow.Dequeue()();
                        }
                    );
                }
            );
        }
开发者ID:skdhayal,项目名称:avalonpipemania,代码行数:101,代码来源:TileFieldTest.cs

示例6: MyCanvas

		public MyCanvas()
		{
			Width = DefaultWidth;
			Height = DefaultHeight;

			#region Gradient
			for (int i = 0; i < DefaultHeight; i += 4)
			{
				new Rectangle
				{
					Fill = ((uint)(0xff00007F + 128 * i / DefaultHeight)).ToSolidColorBrush(),
					Width = DefaultWidth,
					Height = 4,
				}.MoveTo(0, i).AttachTo(this);
			}
			#endregion


			var t = new TextBox
			{
				AcceptsReturn = true,
				Text = "",
				BorderThickness = new Thickness(0),
				Foreground = Brushes.Black,
				Background = Brushes.White,
				IsReadOnly = true,
				Width = 400,
				Height = 300
			}.MoveTo(32, 10).AttachTo(this);

			Assets.Default.FileNames.ForEach(
				(v, index, SignalNext) =>
				{
					t.AppendTextLine(v);

					v.ToStringAsset(
						value =>
						{
							t.AppendTextLine(index + ": " + value);


							500.AtDelay(SignalNext);
						}
					);
				}
			);

			//var c = new FutureStream();


			//// ready for first call
			//c.Signal();

			//foreach (var _v in Assets.Default.FileNames)
			//{
			//    var v = _v;

			//    c.Continue(
			//        SignalNext =>
			//        {

			//            t.AppendTextLine(v);

			//            v.ToStringAsset(
			//                value =>
			//                {
			//                    t.AppendTextLine(value);


			//                    SignalNext();
			//                }
			//            );
			//        }
			//    );
			//}


		}
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:78,代码来源:MyCanvas.cs


注:本文中的System.Windows.Controls.TextBox.AppendTextLine方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。