/// <summary> /// This method help to convert the property value, which is of variable bytes, to ExtendedRuleCondition structure. /// </summary> /// <param name="byteArray">The byte array to be converted.</param> /// <returns>Return the ExtendedRuleCondition structure.</returns> public static ExtendedRuleCondition PropertyValueConvertToExtendedRuleCondition(byte[] byteArray) { // The first 2 bytes of byteArray only indicates the total number of subsequent bytes, // byteArrayTobeConvert is the actual bytes used to convert to the ExtendedRuleCondition structure, // which should not include the first 2 bytes of byteArray. byte[] byteArrayTobeConvert = new byte[byteArray.Length - 2]; Array.Copy(byteArray, 2, byteArrayTobeConvert, 0, byteArray.Length - 2); // Deserialize the byte array value into the ExtendedRuleCondition structure. ExtendedRuleCondition extendedRuleCondition = new ExtendedRuleCondition(); extendedRuleCondition.Deserialize(byteArrayTobeConvert); return extendedRuleCondition; }