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


C# Future.Continue方法代码示例

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


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

示例1: AttachToStack

        public void AttachToStack(CardStack s, Future IsLocalPlayer)
        {
            var c = this;

            if (c.CurrentStack != null)
            {
                c.CurrentStack.Cards.Remove(c);
            }

            c.PreviousStack = c.CurrentStack;
            c.CurrentStack = s;

            s.Cards.Add(c);

            if (this.Moved != null)
                this.Moved();

            // if the IsLocalPlayer is null then we are not meant to raise MovedByLocalPlayer
            if (IsLocalPlayer != null)
                IsLocalPlayer.Continue(
                    delegate
                    {
                        if (this.MovedByLocalPlayer != null)
                            this.MovedByLocalPlayer();
                    }
                );
        }
开发者ID:exaphaser,项目名称:JSC-Cross-Compiler,代码行数:27,代码来源:Card.cs

示例2: System_IO_StringReaderCanvas

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

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

			var help_idle = new Image
			{
				Source = "assets/System_IO_StringReader/help_idle.png".ToSource()
			}.AttachTo(this);

			var help = new Image
			{
				Source = "assets/System_IO_StringReader/help.png".ToSource()
			}.AttachTo(this);

			help.Opacity = 0;

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

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

			var Data = new Future<string>();

			"assets/System_IO_StringReader/data.txt".ToStringAsset(Data);

			Data.Continue(
				value =>
				{
					using (var s = new StringReader(value))
					{
						
						// skip header
						var header = s.ReadLine();

						var _1 = s.ReadLine();
						var _2 = s.ReadLine();

						Console.WriteLine("" + new { _1, _1.Length });
						Console.WriteLine("" + new { _2, _2.Length });

						t.Text = "Content: " + _2;

						var footer = s.ReadLine();

						var empty = s.ReadLine();
					}
				}
			);

			help_idle.Opacity = 0;
			help.Opacity = 1;
			img.Opacity = 0.5;

			t.MouseEnter +=
				delegate
				{
					help_idle.Opacity = 1;
					help.Opacity = 0;

					img.Opacity = 1;
					t.Foreground = 0xffffff00.ToSolidColorBrush();
				};

			t.MouseLeave +=
				delegate
				{
					help_idle.Opacity = 0;
					help.Opacity = 1;

					img.Opacity = 0.5;
					t.Foreground = 0xffffffff.ToSolidColorBrush();
				};



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


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