using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Telerik.Web.UI.DynamicData
{

    public static class UiExtentions
    {
        public static void DbValue(this RadBinaryImage binaryImage, object data)
        {
            if (data is System.Data.Linq.Binary)
            {
                binaryImage.DataValue = ((System.Data.Linq.Binary)data).ToArray();
            }
            else if (data is byte[])
            {
                binaryImage.DataValue = (byte[])data;
            }
            else
            {
                throw new ArgumentOutOfRangeException("data cannot be converted to byte[]");
            }
        }

    }
}