本文整理汇总了C#中System.Windows.Shapes.Rectangle.Orphanize方法的典型用法代码示例。如果您正苦于以下问题:C# Rectangle.Orphanize方法的具体用法?C# Rectangle.Orphanize怎么用?C# Rectangle.Orphanize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Windows.Shapes.Rectangle
的用法示例。
在下文中一共展示了Rectangle.Orphanize方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OrcasAvalonApplicationCanvas
//.........这里部分代码省略.........
{
Console.WriteLine("AttackedBy1");
AttackedBy1.Value = -1;
return;
}
Console.WriteLine("Random");
Tiles.Where(k => k.Value == 0).Random().Value = -1;
};
#endregion
var ResetOverlay = new Rectangle
{
Fill = Brushes.Yellow,
Width = DefaultWidth,
Height = DefaultHeight,
Cursor = Cursors.Hand,
};
//9000.AtDelay(
// delegate
// {
// ResetOverlay.Orphanize();
// InfoOverlayShadowOpacity.Opacity = 0;
// }
//);
ResetOverlay.MouseLeftButtonUp +=
delegate
{
Tiles.ForEach(k => k.Value = 0);
ResetOverlay.Orphanize();
InfoOverlayShadowOpacity.Opacity = 0;
};
Action<Tile> Tiles_WithEvents =
t =>
{
#region add 2d awareness
t.ByOffset =
(ox, oy) =>
{
var x = t.X + ox;
var y = t.Y + oy;
if (x < 0)
return null;
if (y < 0)
return null;
if (x >= Intersections)
return null;
if (y >= Intersections)
return null;
return Tiles[x + y * Intersections];
};
#endregion
t.TouchOverlay.MouseLeftButtonUp +=
delegate
{
if (t.Value != 0)
return;
t.Value = 1;
示例2: ApplicationSprite
//.........这里部分代码省略.........
//at mochi.as3::MochiAd$/unload()
//at MethodInfo-1807()
//at MethodInfo-1793()
// SecurityError: Error #2047: Security sandbox violation: parent: http://xs.mochiads.com/container/MochiAdsCDN-AS3.swf?do_init=1&cacheBust=1359134133659 cannot access app:/AvalonCardGames.AIRFreeCell.ApplicationSprite.swf.
//at flash.display::DisplayObject/get parent()
//at com.mochimedia.container::MochiAdsContainer/initalize()[/home/mochi/src/mochiads_erl/priv/as3/com/mochimedia/container/MochiAdsContainer.as:40]
//at com.mochimedia.targeting::MochiAdsTargeting/onJSONData()[/home/mochi/src/mochiads_erl/priv/as3/com/mochimedia/targeting/MochiAdsTargeting.as:780]
//at flash.events::EventDispatcher/dispatchEventFunction()
//at flash.events::EventDispatcher/dispatchEvent()
//at flash.net::URLLoader/onComplete()
var options = new MochiAdOptions
{
//TypeError: Error #1034: Type Coercion failed: cannot convert AvalonCardGames.AIRFreeCell::[email protected] to flash.display.MovieClip.
// at mochi.as3::MochiAd$/load()[W:\opensource\mochimedia.com\MochiAd.as:789]
// at mochi.as3::MochiAd$/showPreGameAd()[W:\opensource\mochimedia.com\MochiAd.as:185]
// at AvalonCardGames.AIRFreeCell::MochiAdOptions/showPreGameAd_100664136()[U:\web\AvalonCardGames\AIRFreeCell\MochiAdOptions.as:74]
// at AvalonCardGames.AIRFreeCell::ApplicationSprite/__ctor_b__1_100663300()[U:\web\AvalonCardGames\AIRFreeCell\ApplicationSprite.as:82]
clip = clip,
id = _mochiads_game_id,
res = this.stage.stageWidth + "x" + this.stage.stageHeight,
ad_finished =
delegate
{
this.removeChild(clip);
shadow.Orphanize();
{
var now = DateTime.Now;
Console.WriteLine(now + " ready! " + new { Security.sandboxType });
}
}
};
{
var now = DateTime.Now;
Console.WriteLine(now + " can we get some ads? " + new { Security.sandboxType });
}
options.showPreGameAd();
}
}
);
#region AtInitializeConsoleFormWriter
var w = new __OutWriter();
var o = Console.Out;
var __reentry = false;
var __buffer = new StringBuilder();
w.AtWrite =
x =>
{
__buffer.Append(x);
};
示例3: ApplyFrame
private BitmapImage ApplyFrame(int imagenum)
{
if (ApplyFrameCache.ContainsKey(imagenum))
return ApplyFrameCache[imagenum];
var nw = DefaultWidth / 36;
var n = new Rectangle
{
Width = nw,
Height = nw / 2,
Fill = Brushes.Blue
}.MoveTo(nw * imagenum, DefaultHeight - nw / 2).AttachTo(this);
var src_uri = new BitmapImage();
ApplyFrameCache[imagenum] = src_uri;
src_uri.DownloadCompleted +=
delegate
{
//bg.Fill = Color_Active();
500.AtDelay(
delegate
{
n.Orphanize();
}
);
};
src_uri.DownloadFailed +=
delegate
{
n.Fill = Brushes.Red;
//bg.Fill = Color_Error();
};
src_uri.BeginInit();
src_uri.UriSource = new Sketchup { mid = Current.mid, imagenum = imagenum };
src_uri.EndInit();
return src_uri;
}
示例4: ImageCarouselCanvas
//.........这里部分代码省略.........
}
};
Canvas.SetZIndex(logo, 500);
logo.AttachTo(this).MoveTo(
(DefaultWidth - args.ImageDefaultWidth) / 2,
(DefaultHeight - args.ImageDefaultHeight) / 2
);
var logo_hit = new Rectangle
{
Fill = Brushes.Red,
Opacity = 0
};
Canvas.SetZIndex(logo_hit, 501);
logo_hit.Cursor = Cursors.Hand;
logo_hit.AttachTo(this).MoveTo(
(DefaultWidth - args.ImageDefaultWidth) / 2,
(DefaultHeight - args.ImageDefaultHeight) / 2
);
logo_hit.SizeTo(args.ImageDefaultWidth, args.ImageDefaultHeight);
#region MouseLeftButtonUp
logo_hit.MouseLeftButtonUp +=
delegate
{
if (AtLogoClick != null)
AtLogoClick();
//new Uri("http://www.jsc-solutions.net").NavigateTo(this.Container);
if (CloseOnClick)
{
Close();
logo_hit.Orphanize();
}
};
#endregion
#region HideSattelites
this.HideSattelites =
delegate
{
SattelitesHidden = true;
Action TriggerClose = () => AtAnimation =
t =>
{
if (images.Any(k => k.Opacity > 0))
return;
t.Stop();
if (AtClose != null)
AtClose();
};
AtAnimation =
t =>
{
if (images.Any(k => k.Opacity < 1))
return;
foreach (var item__ in images.ToArray())
{
var item = item__;
var NextDelay = 1;
if (!DisableTimerShutdown)
NextDelay = 1 + 1000.Random();
WaitAndAppear(NextDelay, StepSpeedToToggleSattelites, n => item.Opacity = 1 - n);
}
if (DisableTimerShutdown)
{
AtAnimation = delegate { };
}
else
TriggerClose();
};
};
#endregion
this.Close =
delegate
{
WaitAndAppear(1, 0.12, n => logo.Opacity = 1 - n);
HideSattelites();
};
}
示例5: Step5_ShowMistakeMatrix
public void Step5_ShowMistakeMatrix(
AeroNavigationBar.HistoryInfo History,
LinkImage[] Source,
ComparisionInfo[] Comparision,
ComparisionValue[] Values)
{
History.AddFrame(
delegate
{
var More = Comparision.Count(k => k.WaitingForUser && k.Value == null);
#region headers
var o = Source.Select<LinkImage, Action>(
(k, i) =>
{
k.SizeTo(0.15);
k.AttachContainerTo(this);
k.MoveContainerTo(60, 150 + i * 60);
var kx = new TextButtonControl
{
Text = "#" + (1 + i),
Width = 40,
Height = 32
};
kx.AttachContainerTo(this);
kx.MoveContainerTo(130, 160 + i * 60);
kx.Background.Fill = Brushes.White;
kx.Background.Opacity = 0.3;
var ky = new TextButtonControl
{
Text = "#" + (1 + i),
Width = 40,
Height = 32
};
ky.AttachContainerTo(this);
ky.MoveContainerTo(200 + i * 60, 100);
ky.Background.Fill = Brushes.White;
ky.Background.Opacity = 0.3;
var kxr = new Rectangle
{
Fill = Brushes.Black,
Width = Source.Length * 60 + 140,
Height = 1
};
kxr.AttachTo(this);
kxr.MoveTo(60, 200 + i * 60);
var kyr = new Rectangle
{
Fill = Brushes.Black,
Height = Source.Length * 60 + 60,
Width = 1
};
kyr.AttachTo(this);
kyr.MoveTo(250 + i * 60, 100);
return delegate
{
k.OrphanizeContainer();
kx.OrphanizeContainer();
ky.OrphanizeContainer();
kxr.Orphanize();
kyr.Orphanize();
};
}
).ToArray();
#endregion
#region values
var Mistakes = Comparision.Where(q => q.WaitingForUser).ToArray(
q =>
{
var x_cells =
Comparision.Where(k => k.X == q.Y).OrderBy(k => k.Y).ToArray();
var x_product =
x_cells.Product(k => k.GetCurrentValue());
var y_cells =
Comparision.Where(k => k.Y == q.X).OrderBy(k => k.X).ToArray();
var y_product =
y_cells.Product(k => k.GetCurrentValue());
var z = Math.Pow(q.GetCurrentValue(), Source.Length);
return new { q, Mistake = 1.0 / Math.Pow(x_product * y_product * z, 1.0 / (Source.Length - 2)) };
//.........这里部分代码省略.........
示例6: Step4_ShowMatrix
public void Step4_ShowMatrix(
AeroNavigationBar.HistoryInfo History,
LinkImage[] Source,
ComparisionInfo[] Comparision,
ComparisionValue[] Values)
{
History.AddFrame(
delegate
{
var More = Comparision.Count(k => k.WaitingForUser && k.Value == null);
this.Title.Text = "The Matrix. You have " + More + " image pairs to compare...";
#region headers
var o = Source.Select<LinkImage, Action>(
(k, i) =>
{
k.SizeTo(0.15);
k.AttachContainerTo(this);
k.MoveContainerTo(60, 150 + i * 60);
var kx = new TextButtonControl
{
Text = "#" + (1 + i),
Width = 40,
Height = 32
};
kx.AttachContainerTo(this);
kx.MoveContainerTo(130, 160 + i * 60);
kx.Background.Fill = Brushes.White;
kx.Background.Opacity = 0.3;
var ky = new TextButtonControl
{
Text = "#" + (1 + i),
Width = 40,
Height = 32
};
ky.AttachContainerTo(this);
ky.MoveContainerTo(200 + i * 60, 100);
ky.Background.Fill = Brushes.White;
ky.Background.Opacity = 0.3;
var kxr = new Rectangle
{
Fill = Brushes.Black,
Width = Source.Length * 60 + 140,
Height = 1
};
kxr.AttachTo(this);
kxr.MoveTo(60, 200 + i * 60);
var kyr = new Rectangle
{
Fill = Brushes.Black,
Height = Source.Length * 60 + 60,
Width = 1
};
kyr.AttachTo(this);
kyr.MoveTo(250 + i * 60, 100);
return delegate
{
k.OrphanizeContainer();
kx.OrphanizeContainer();
ky.OrphanizeContainer();
kxr.Orphanize();
kyr.Orphanize();
};
}
).ToArray();
#endregion
#region values
var v = Comparision.Select<ComparisionInfo, Action>(
k =>
{
var kt = new TextButtonControl
{
Text = "",
Width = 40,
Height = 32
};
kt.AttachContainerTo(this);
kt.MoveContainerTo(200 + k.X * 60, 160 + k.Y * 60);
kt.Background.Fill = Brushes.White;
kt.Background.Opacity = 0.3;
if (k.Value == null)
{
if (k.WaitingForUser)
{
//.........这里部分代码省略.........
示例7: Apply
public void Apply(object Sender, OrcasAvalonApplicationCanvas World, Action<Action> AddDispose)
{
var Settings = new[] {
new {Brush = Brushes.Red, Opacity = 0.5 },
new {Brush = Brushes.Yellow, Opacity = 0.5 },
new {Brush = Brushes.Purple, Opacity = 0.2 },
}.AtModulus(Z);
var a = new Rectangle
{
Width = 4,
Height = 8,
Fill = Settings.Brush,
Opacity = Settings.Opacity
}.AttachTo(World).MoveTo(X + 2, Y);
var b = new Rectangle
{
Width = 8,
Height = 4,
Fill = Settings.Brush,
Opacity = Settings.Opacity
}.AttachTo(World).MoveTo(X, Y + 2);
AddDispose(() => a.Orphanize());
AddDispose(() => b.Orphanize());
if (Next != null)
Next.Apply(Sender, World, AddDispose);
}
示例8: AvalonQueryExampleCanvas
public AvalonQueryExampleCanvas()
{
CheckIsPanel();
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 = 5,
}.MoveTo(0, i).AttachTo(this);
}
#endregion
new Image
{
Source = "assets/FlashAvalonQueryExample/labels.png".ToSource()
}.MoveTo(0, 0).AttachTo(this);
//var FaciconService = "http://www.google.com/s2/favicons?domain=";
// http://www.google.com/s2/favicons?domain=wordpress.com
var KnownDomains = "63/155262375_104aee1bb0, 3183/2825405970_a1469cd673, 2336/2454679206_de5176b827, 3178/2825551196_6548ff54b9";
var KnownFilter = "31";
Func<Brush> Color_Inactive = () => 0xffc0c0c0.ToSolidColorBrush();
Func<Brush> Color_Active = () => 0xffffffff.ToSolidColorBrush();
Func<Brush> Color_Error = () => 0xffffff80.ToSolidColorBrush();
var KnownDomainsInputHeight = 100;
var KnownDomainsInput = new TextBox
{
AcceptsReturn = true,
FontSize = 15,
Text = KnownDomains,
BorderThickness = new Thickness(0),
//Foreground = 0xffffffff.ToSolidColorBrush(),
Background = Color_Inactive(),
Width = 400,
Height = KnownDomainsInputHeight,
TextWrapping = TextWrapping.Wrap
}.MoveTo(32, 32).AttachTo(this);
KnownDomainsInput.Orphanize();
KnownDomainsInput.AttachTo(this);
Action<TextBox> ApplyActiveColor =
e =>
{
e.GotFocus +=
delegate
{
e.Background = Color_Active();
};
e.LostFocus +=
delegate
{
e.Background = Color_Inactive();
};
};
ApplyActiveColor(KnownDomainsInput);
var FilterInputHeight = 22;
var FilterInput = new TextBox
{
FontSize = 15,
Text = KnownFilter,
BorderThickness = new Thickness(0),
//Foreground = 0xffffffff.ToSolidColorBrush(),
Background = Color_Inactive(),
Width = 400,
Height = FilterInputHeight,
}.MoveTo(32, 32 + KnownDomainsInputHeight + 4).AttachTo(this);
ApplyActiveColor(FilterInput);
var AnyInputChangedBefore = new List<Action>();
Action AnyInputChanged =
delegate
{
AnyInputChangedBefore.Do();
AnyInputChangedBefore.Clear();
var query = from k in KnownDomainsInput.Text.Split(',')
let t = k.Trim()
where t.Contains(FilterInput.Text)
orderby t
select t;
//.........这里部分代码省略.........