private void CalculateValueType() { if (this.isValueTypeInitialized) { return; } this.valueType = ContactValueType.Unknown; if (this.valueTypeParameter != null) { this.valueType = ContactCommon.GetValueTypeEnum(this.valueTypeParameter); } else { PropertyId propertyEnum = ContactCommon.GetPropertyEnum(this.propertyName); if (propertyEnum != PropertyId.Unknown) { this.valueType = ContactCommon.GetDefaultValueType(propertyEnum); } } if (this.valueType == ContactValueType.Unknown) { this.valueType = ContactValueType.Text; } this.isValueTypeInitialized = true; }
public void WriteParameterValue(string value) { if (value == null) { throw new ArgumentNullException("value"); } this.AssertValidState(WriteState.Parameter); if (this.firstParameterValue) { this.writer.WriteStartValue(); this.firstParameterValue = false; } else { this.writer.WriteNextValue(ContentLineParser.Separators.Comma); } if (this.parameter == ParameterId.ValueType && value.Length > 0) { this.valueType = ContactCommon.GetValueTypeEnum(value); } bool flag = this.IsQuotingRequired(value); if (flag) { this.writer.WriteToStream(34); } this.writer.WriteToStream(value); if (flag) { this.writer.WriteToStream(34); } }