public void getItemValues(out int[] aItemHandles, out object[] aItemValues) { mValueChanged = false; List <int> lHandles = new List <int>(); List <object> lValues = new List <object>(); if (mDataFlow.HasFlag(EDataFlow.TO) && mBitsValueChanged) { mBitsValueChanged = false; object lValueObject = mItemBrowser.readItemOrInitValue(mBitsValueItemHandle); Type lValueType = lValueObject.GetType(); checkType(lValueType); ulong lValueUInt64 = BinaryConverters.ToUInt64(lValueObject); for (int i = 0; i < mBitsValue.Length; i++) { setBitValue(ref lValueUInt64, i, mBitsValue[i]); } lHandles.Add(mBitsValueItemHandle); lValues.Add(BinaryConverters.FromUInt64(lValueType, lValueUInt64)); } if (mDataFlow.HasFlag(EDataFlow.FROM)) { for (int i = 0; i < mBitItemHandles.Length; i++) { if (mBitValueChanged[i] && mBitItemHandles[i] != -1) { mBitValueChanged[i] = false; lHandles.Add(mBitItemHandles[i]); lValues.Add(mBitsValue[i]); } } } aItemHandles = lHandles.ToArray(); aItemValues = lValues.ToArray(); }
private bool getBitValue(object aSrc, int aIndex) { return((BinaryConverters.ToUInt64(aSrc) & 1UL << aIndex) > 0); }