SIL.FieldWorks.CacheLight.RealDataCache.BinaryPropRgb C# (CSharp) Method

BinaryPropRgb() public method

Member BinaryPropRgb
ISilDataAccess method
public BinaryPropRgb ( int obj, int tag, [ MarshalTypeRef, int cbMax, int &cb ) : void
obj int obj
tag int tag
MarshalTypeRef [
cbMax int cbMax
cb int cb
return void
		public void BinaryPropRgb(int obj, int tag, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ArrayPtrMarshaler), SizeParamIndex = 3)] ArrayPtr/*byte[]*/ rgb, int cbMax, out int cb)
		{
			CheckDisposed();

			CheckBasics(obj);

			var key = new HvoFlidKey(obj, tag);
			var removeFromCache = false;
			if (!m_basicByteArrayCache.ContainsKey(key))
				removeFromCache = CheckForVirtual(obj, tag);
			var array = m_basicByteArrayCache[key];
			if (removeFromCache)
				m_basicByteArrayCache.Remove(key);
			cb = array.Length;
			if (cbMax == 0)
				return;
			if (cb > cbMax)
				throw new ArgumentException("cb cannot be larger than cbMax");

			MarshalEx.ArrayToNative(rgb, cbMax, array);
		}