本文整理汇总了C#中ScriptCoreLib.Where方法的典型用法代码示例。如果您正苦于以下问题:C# ScriptCoreLib.Where方法的具体用法?C# ScriptCoreLib.Where怎么用?C# ScriptCoreLib.Where使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ScriptCoreLib
的用法示例。
在下文中一共展示了ScriptCoreLib.Where方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetData
public int[] GetData(Func<int, bool> c)
{
var source = new[] { 9, 8, 7, 6, 5, 4, 3, 2, 1 };
var value = source.Where(x => c(x)).ToArray();
return value;
}
示例2: Application
public Application(IDefaultPage page)
{
Action AllImagesLoaded =
delegate
{
var data = new[] { -0.5 };
var query = from a in data
select a ;
foreach (var v in query)
{
var __hint8 = "before iteration data0";
var data0 = data.Where(i => true);
var __hint11 = "after iteration";
}
};
}
示例3: Application
//.........这里部分代码省略.........
at_set_cursor_position +=
(xx, yy) =>
{
var xml = new XElement("at_set_cursor_position",
// int not yet supported?
new XAttribute("x", "" + xx),
new XAttribute("y", "" + yy)
);
mothership_postXElement(
xml
);
};
#endregion
// now we can reply..
this.device_onmessage +=
(source_device_id, xml) =>
{
#region at_virtualwindowsync_reconfigure
if (source_device_id != 0)
if (xml.Name.LocalName == "at_virtualwindowsync_reconfigure")
{
int __device_id = int.Parse(xml.Attribute("device_id").Value);
if (__device_id == device_id)
{
// are we being reconfigured?
friendly_devices.Where(k => k.source_device_id == source_device_id).WithEach(
q =>
{
int dx = int.Parse(xml.Attribute("dx").Value);
int dy = int.Parse(xml.Attribute("dy").Value);
disable_bind_reconfigure = true;
q.f.MoveTo(
fw.Left - dx,
fw.Top - dy
);
disable_bind_reconfigure = false;
}
);
}
}
#endregion
#region at_virtualwindowsync
if (source_device_id != 0)
if (xml.Name.LocalName == "at_virtualwindowsync")
{
Console.WriteLine("got at_virtualwindowsync");
// do we know this device?
var q = friendly_devices.FirstOrDefault(k => k.source_device_id == source_device_id);
int w = int.Parse(xml.Attribute("w").Value);
int h = int.Parse(xml.Attribute("h").Value);
Action reposition = delegate { };