本文整理汇总了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();
}
);
}
示例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();
};
}