示例#1
0
        private static ListItem <ILogItem> Merge_AddItem(
            this ILogList MergeList, ILogList FromList, ListItem <ILogItem> Item)
        {
            var addItem = Item.Value.NewCopy();

            addItem.ApppendMergeName(FromList);

            MergeList.AddItem(addItem);

            var nextItem = FromList.NextItem(Item);

            return(nextItem);
        }
示例#2
0
        public static ILogList MergeOld(this ILogList List1, ILogList List2, ILogList List3 = null)
        {
            ILogList merge = null;

            if (List1 != null)
            {
                merge = List1.NewList();
            }
            else if (List2 != null)
            {
                merge = List2.NewList();
            }
            else if (List3 != null)
            {
                merge = List3.NewList();
            }

            var item1 = List1?.NextItem(null);
            var item2 = List2?.NextItem(null);

            while ((item1 != null) || (item2 != null))
            {
                if (item1 == null)
                {
                    item2 = merge.Merge_AddItem(List2, item2);
                }
                else if (item2 == null)
                {
                    item1 = merge.Merge_AddItem(List1, item1);
                }
                else if (item1.Value.LogTime <= item2.Value.LogTime)
                {
                    item1 = merge.Merge_AddItem(List1, item1);
                }
                else
                {
                    item2 = merge.Merge_AddItem(List2, item2);
                }
            }

            return(merge);
        }