コード例 #1
0
        public static int CompareByTradeID(TradeOrderData o1, TradeOrderData o2)
        {
            if (o1 == null && o2 == null)
            {
                return(0);
            }
            if (o1 == null)
            {
                return(-1);
            }
            if (o2 == null)
            {
                return(1);
            }

            if (o1._TradeID.CompareTo(o2._TradeID) == 1)
            {
                return(-1);
            }
            else if (o1._TradeID.CompareTo(o2._TradeID) == -1)
            {
                return(1);
            }
            else if (o1._TradeID.CompareTo(o2._TradeID) == 0)
            {
                if (o1.TradeTime != null && o2.TradeTime != null)
                {
                    if (o1.TradeTime.StartsWith("2") && !o2.TradeTime.StartsWith("2"))
                    {
                        return(1);
                    }
                    else if (!o1.TradeTime.StartsWith("2") && o2.TradeTime.StartsWith("2"))
                    {
                        return(-1);
                    }
                }
                else
                {
                    return(-1);
                }

                if (o1.TradeTime.CompareTo(o2.TradeTime) < 0)
                {
                    return(1);
                }
                if (o1.TradeTime.CompareTo(o2.TradeTime) == 0)
                {
                    return(0);
                }
            }
            return(-1);
        }
コード例 #2
0
        public static int CompareByCode(TradeOrderData o1, TradeOrderData o2)
        {
            if (o1 == null && o2 == null)
            {
                return(0);
            }
            if (o1 == null)
            {
                return(-1);
            }
            if (o2 == null)
            {
                return(1);
            }

            if (o1._Code.Length > 6 && o2._Code.Length <= 6)
            {
                return(1);
            }
            else if (o1._Code.Length <= 6 && o2._Code.Length > 6)
            {
                return(-1);
            }
            else
            {
                if (o1._Code.CompareTo(o2._Code) == 1)
                {
                    return(1);
                }
                else if (o1._Code.CompareTo(o2._Code) == -1)
                {
                    return(-1);
                }
                else if (o1._Code.CompareTo(o2._Code) == 0)
                {
                    if (o1._TradeHandCount.CompareTo(o2._TradeHandCount) > 0)
                    {
                        return(1);
                    }
                    if (o1._TradeHandCount.CompareTo(o2._TradeHandCount) < 0)
                    {
                        return(-1);
                    }
                    if (o1._TradeHandCount.CompareTo(o2._TradeHandCount) == 0)
                    {
                        return(0);
                    }
                }
            }
            return(1);
        }
コード例 #3
0
        public TradeOrderData Copy()
        {
            TradeOrderData ret = (TradeOrderData)this.MemberwiseClone();

            return(ret);
        }