public bool CopyFrameTo(ref ProtoFrame destination, bool forceCopy = false) { bool retVal = false; if (forceCopy) { destination.DataLength = DataLength; destination.rawFrame = new byte[MaxLength]; for (int i = 0; i < MaxLength; i++) { destination.rawFrame[i] = rawFrame[i]; } destination.ReceivedTimestamp = ReceivedTimestamp; retVal = true; } else if (destination.MID == MID && destination.LEN == LEN) { for (int i = 0; i < destination.DataLength; i++) { destination[i] = this[i]; } destination.ReceivedTimestamp = ReceivedTimestamp; retVal = true; } else { retVal = false; } return(retVal); }
public ProtoFrame(ProtoFrame copySource) { DataLength = copySource.DataLength; for (int i = 0; i < MaxLength; i++) { rawFrame[i] = copySource.rawFrame[i]; } }