public void ApplySortAction(IDictionary<int, IList<IBinaryDataListItem>> payload)
{
// Apply IDic back into my object ;)
foreach(int i in payload.Keys)
{
// TODO : What if they are in different locations?
StorageKey sk = new StorageKey(DataListKey, i + GenerateKeyPrefix(Namespace, DataListKey));
BinaryDataListRow row;
short colCnt = (short)Columns.Count;
if(_itemStorage.TryGetValue(sk, colCnt, out row))
{
IList<IBinaryDataListItem> cols;
if(payload.TryGetValue(i, out cols))
{
foreach(IBinaryDataListItem c in cols)
{
int idx = InternalFetchColumnIndex(c.FieldName);
string theValue;
try
{
theValue = c.TheValue;
}
catch(Exception)
{
theValue = null;
}
row.UpdateValue(theValue, idx, colCnt);
}
_itemStorage.TrySetValue(sk, colCnt, row);
}
}
}
}