本文整理汇总了C#中Model.List.Skip方法的典型用法代码示例。如果您正苦于以下问题:C# List.Skip方法的具体用法?C# List.Skip怎么用?C# List.Skip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Model.List
的用法示例。
在下文中一共展示了List.Skip方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Star
public ICollection<Helper.Point> Star( Helper.Point posIni, Helper.Point posFinal, out int totalCost)
{
var heapBorder = new Heap<Elem>();
// Console.WriteLine("cheguei no astar");
List<Elem> explored = new List<Elem>();
/* Array to verify if a position was explored */
var hasExpl = new bool[qtdNodes,qtdNodes];
var inBorder = new bool[qtdNodes,qtdNodes];
hasExpl.Initialize();
inBorder.Initialize();
Elem father = new Elem(0, posIni);
heapBorder.HeapAdd( h(posIni,posFinal), father );
while (heapBorder.HeapSize() > 0 )
{
father = heapBorder.HeapExtractMin().Item3 ;
inBorder[father.pos.x, father.pos.y] = false;
if( father.pos.Equals(posFinal) )
break;
explored.Insert(0, father);
hasExpl[father.pos.x, father.pos.y] = true;
foreach (var child in father.pos.Neighborhood( posFinal) )
{
int accChild = 0;
accChild = father.accCost + 1;
if (hasExpl[child.x, child.y] && accChild >= father.accCost)
continue;
if (inBorder[child.x, child.y] == false || accChild < father.accCost)
{
heapBorder.HeapAdd(h(child, posFinal) + accChild, new Elem(accChild, child, father.pos));
inBorder[child.x, child.y] = true;
}
}
}
var pathReturn = new List<Helper.Point>();
pathReturn.Insert(0, father.pos );
totalCost = father.accCost;
if (!father.parent.HasValue)
return pathReturn;
var currParent = father.parent.Value ;
for (int i = 0 , j = 1; i < explored.Count; i++)
{
if (explored[i].pos.Equals(currParent) )
{
pathReturn.Insert(j,explored[i].pos);
j++;
currParent = explored[i].parent.HasValue ? explored[i].parent.Value : posIni ;
//Debug.WriteLine("custo "+explored[i].accCost);
}
}
pathReturn.Reverse();
return pathReturn.Skip(1).ToList();
}
示例2: DataTable_IgnoreGroups
public JsonResult DataTable_IgnoreGroups(jQueryDataTableParamModel param, List<String> SubjectID = null, List<String> Class = null, List<String> Check = null, String Search = null, String ShowIgnore = null, String ShowNotIgnore = null)
{
if (SubjectID != null && Class != null && Check != null)
{
OutputHelper.SaveIgnoreGroups(SubjectID, Class, Check, false);
}
Dictionary<String, Group> dbGroups = Clone.Dictionary<String, Group>((Dictionary<String, Group>)(CurrentSession.Get("IgnoreGroups") ?? InputHelper.Groups));
//Dictionary<String, Group> dbGroups = InputHelper.Groups;
var Groups = from m in dbGroups.Values select m;
var total = Groups.Count();
if (!string.IsNullOrEmpty(Search))
{
Groups = Groups.Where(m => m.MaMonHoc.ToLower().Contains(Search.ToLower()) || m.TenMonHoc.ToLower().Contains(Search.ToLower()));
}
if (ShowIgnore != null && ShowNotIgnore != null)
{
if (ShowIgnore == "checked" && ShowNotIgnore != "checked")
{
Groups = Groups.Where(m => m.IsIgnored == true);
}
if (ShowIgnore != "checked" && ShowNotIgnore == "checked")
{
Groups = Groups.Where(m => m.IsIgnored == false);
}
if (ShowIgnore != "checked" && ShowNotIgnore != "checked")
{
Groups = Groups.Where(m => false);
}
}
var Result = new List<string[]>();
var MH = (from m in InputHelper.db.This
select new
{
MaMonHoc = m.MaMonHoc,
Nhom = m.Nhom,
}).Distinct();
Dictionary<String, List<String>> CheckMH = new Dictionary<string, List<string>>();
foreach (var m in MH)
{
if (CheckMH.ContainsKey(m.MaMonHoc))
CheckMH[m.MaMonHoc].Add(m.Nhom);
else
CheckMH.Add(m.MaMonHoc, new List<String> { m.Nhom });
}
foreach (var su in Groups.OrderBy(m => m.TenMonHoc))
{
if (CheckMH.ContainsKey(su.MaMonHoc))
{
if (!CheckGroup(CheckMH[su.MaMonHoc], su.Nhom.ToString()))
{
Result.Add(new string[] {
su.MaMonHoc,
su.TenMonHoc,
su.TenBoMon,
su.TenKhoa,
su.Nhom.ToString(),
su.SoLuongDK.ToString(),
su.IsIgnored ? "checked" : "",
}
);
}
}
else
{
Result.Add(new string[] {
su.MaMonHoc,
su.TenMonHoc,
su.TenBoMon,
su.TenKhoa,
su.Nhom.ToString(),
su.SoLuongDK.ToString(),
su.IsIgnored ? "checked" : "",
}
);
}
}
return Json(new
{
sEcho = param.sEcho,
iTotalRecords = Result.Count(),
iTotalDisplayRecords = Result.Count(),
//iTotalDisplayedRecords = Subjects.Count(),
aaData = Result.Skip(param.iDisplayStart).Take(param.iDisplayLength)
},
JsonRequestBehavior.AllowGet
);
}