Ejemplo n.º 1
0
        public static LogRowKey FindClosestRowKey(this IItemDatabase db, long sourceUniqueId, long sourceCycleIndex, string itemId, long[] uniqueIds)
        {
            for (int i = uniqueIds.Length - 1; i >= 0; i--)
            {
                if (uniqueIds[i] >= sourceUniqueId)
                {
                    continue;
                }

                LogRowData row = db.GetItemRow(itemId, uniqueIds[i]);
                if (row.CycleIndex == sourceCycleIndex && row.HasExpression())
                {
                    continue;
                }

                return(new LogRowKey(uniqueIds[i], db.GetItemRow(itemId, uniqueIds[i])));
            }

            return(null);
        }