public OptionClass(string property, byte[] data, bool isNewVersion) { this.propertyName = property; this.optionData = data; DataView dataView = ProtocolData.Translation(this.propertyName, isNewVersion); if (dataView != null && dataView.Count > 0) { this.optionType = (ushort)dataView[0]["code"]; this.maxLength = (byte)((uint)Convert.ToByte(dataView[0]["maxLength"].ToString().Trim()) + 3U); this.dataType = dataView[0]["dataType"].ToString().Trim(); this.createOption(); } else { this.maxLength = (byte)0; } }
public void RefreshOption(bool isNewVersion) { DataRowView dataRowView = (int)this.optionType < 179 || (int)this.optionType >= 184 ? ((int)this.optionType < 184 || (int)this.optionType >= 189 ? ProtocolData.Translation(this.optionType, isNewVersion) : ProtocolData.Translation((ushort)184, isNewVersion)) : ProtocolData.Translation((ushort)179, isNewVersion); this.propertyName = dataRowView["propertyName"].ToString().Trim(); this.dataType = dataRowView["dataType"].ToString().Trim(); this.maxLength = (byte)((uint)Convert.ToByte(dataRowView["maxLength"].ToString().Trim()) + 3U); }