本文整理汇总了C#中SortedList.Reverse方法的典型用法代码示例。如果您正苦于以下问题:C# SortedList.Reverse方法的具体用法?C# SortedList.Reverse怎么用?C# SortedList.Reverse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SortedList
的用法示例。
在下文中一共展示了SortedList.Reverse方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Evaluate
public override FScheme.Value Evaluate(FSharpList<FScheme.Value> args)
{
Solid thisSolid = (Solid)((FScheme.Value.Container)args[0]).Item;
Line selectLine = (Line)((FScheme.Value.Container)args[1]).Item;
FaceArray faceArr = thisSolid.Faces;
var thisEnum = faceArr.GetEnumerator();
SortedList<double, Autodesk.Revit.DB.Face> intersectingFaces = new SortedList<double, Autodesk.Revit.DB.Face>();
for (; thisEnum.MoveNext(); )
{
Autodesk.Revit.DB.Face thisFace = (Autodesk.Revit.DB.Face)thisEnum.Current;
IntersectionResultArray resultArray = null;
SetComparisonResult resultIntersect = thisFace.Intersect(selectLine, out resultArray);
if (resultIntersect != SetComparisonResult.Overlap)
continue;
bool first = true;
double linePar = -1.0;
foreach (IntersectionResult ir in resultArray)
{
double irPar = ir.Parameter;
if (first == true)
{
linePar = irPar;
first = false;
}
else if (irPar < linePar)
linePar = irPar;
}
intersectingFaces.Add(linePar, thisFace);
}
var result = FSharpList<FScheme.Value>.Empty;
var intersectingFacesEnum = intersectingFaces.Reverse().GetEnumerator();
for (; intersectingFacesEnum.MoveNext(); )
{
Autodesk.Revit.DB.Face faceObj = intersectingFacesEnum.Current.Value;
result = FSharpList<FScheme.Value>.Cons(FScheme.Value.NewContainer(faceObj), result);
}
return FScheme.Value.NewList(result);
}
示例2: getRankIndex
private int getRankIndex(double newrank, SortedList<double, PlayerScore> TopScores)
{
int idx = 1;
foreach (KeyValuePair<double,PlayerScore> item in TopScores.Reverse())
{
if (item.Key > newrank)
{
idx++;
}
}
return idx;
}
示例3: RefreshFolderOverviewCache
private void RefreshFolderOverviewCache()
{
var items = new SortedList<DateTime, BaseItem>();
FindNewestChildren(folder, items, 20);
folderOverviewCache = string.Join("\n", items.Reverse()
.Select(i => i.Value.LongName)
.ToArray());
}
示例4: match
public string[] match(string name)
{
name = name.ToLower();
// sort student list according to similarity
SortedList<double, string> result = new SortedList<double,string>();
foreach (string item in list)
{
double s = name.DiceCoefficient(item.ToLower());
while (result.ContainsKey(s))
s += 1e-10;
result.Add(s, item);
}
// fetch student list ordered by similarity
List<string> output = new List<string>();
foreach (KeyValuePair<double, string> pair in result.Reverse())
{
output.Add(pair.Value);
}
return output.ToArray<string>();
}