c# List Sort 简单实现

vtTick.Sort((Comparison<CtpTick>)delegate(CtpTick a,CtpTick b)
                    {
                        if (a.UpdateTime < b.UpdateTime)
                            return -1;
                        if (a.UpdateTime > b.UpdateTime)
                            return 1;
                        if (a.doneVolume < b.doneVolume)
                            return -1;
                        if (a.doneVolume > b.doneVolume)
                            return 1;
                        //下面是无奈之举,都怪CTP没有updSerial,加个序号很难吗!?
                        if (a.WriteTime < b.WriteTime)
                            return -1;
                        if (a.WriteTime > b.WriteTime)
                            return 1;
                        return 0;
                    });          


posted on 2013-02-16 13:46  norsd  阅读(188)  评论(0编辑  收藏  举报

导航