当前位置: 首页>>代码示例>>C#>>正文


C# SortedList.Reverse方法代码示例

本文整理汇总了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);
        }
开发者ID:kscalvin,项目名称:Dynamo,代码行数:45,代码来源:Face.cs

示例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;
 }
开发者ID:kysongardner,项目名称:Austris,代码行数:12,代码来源:Window1.xaml.cs

示例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());
 }
开发者ID:purplecow,项目名称:Media-Browser,代码行数:8,代码来源:FolderModel.cs

示例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>();
        }
开发者ID:lwqeva,项目名称:FuzzyMatch,代码行数:23,代码来源:StudentList.cs


注:本文中的SortedList.Reverse方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。