public override bool Equals(object obj)
        {
            NumericFieldValue other = obj as NumericFieldValue;

            if (other != null)
            {
                return(other.Value == Value && other.FormattedValue == FormattedValue);
            }
            return(base.Equals(obj));
        }
Exemple #2
0
        private void writeNumericFieldValue(NumericFieldValue numericFieldValue)
        {
            if (numericFieldValue == null)
            {
                return;
            }

            writer.WriteStartElement("NumericFieldValue", Namespaces[Constants.esriMappingPrefix]);
            if (!string.IsNullOrEmpty(numericFieldValue.FormattedValue))
            {
                writer.WriteAttributeString("FormattedValue", numericFieldValue.FormattedValue);
            }
            if (!double.IsNaN(numericFieldValue.Value))
            {
                writer.WriteAttributeString("Value", numericFieldValue.Value.ToString(CultureInfo.InvariantCulture));
            }
            writer.WriteEndElement();
        }
Exemple #3
0
        private void writeUniqueValueObj(object uniqueValueInfo)
        {
            if (uniqueValueInfo == null)
            {
                return;
            }

            NumericFieldValue numericFieldValue = uniqueValueInfo as NumericFieldValue;

            if (numericFieldValue != null)
            {
                writer.WriteStartElement("UniqueValueInfoObj.SerializedValue", Namespaces[Constants.esriMappingPrefix]);
                writeNumericFieldValue(numericFieldValue);
                writer.WriteEndElement();
                return;
            }

            AttachmentFieldValue attFieldValue = uniqueValueInfo as AttachmentFieldValue;

            if (attFieldValue != null)
            {
                writer.WriteStartElement("UniqueValueInfoObj.SerializedValue", Namespaces[Constants.esriMappingPrefix]);
                writeAttachmentFieldValue(attFieldValue);
                writer.WriteEndElement();
                return;
            }

            CurrencyFieldValue currFieldValue = uniqueValueInfo as CurrencyFieldValue;

            if (currFieldValue != null)
            {
                writer.WriteStartElement("UniqueValueInfoObj.SerializedValue", Namespaces[Constants.esriMappingPrefix]);
                writeCurrencyFieldValue(currFieldValue);
                writer.WriteEndElement();
                return;
            }

            EntityFieldValue entityFieldValue = uniqueValueInfo as EntityFieldValue;

            if (entityFieldValue != null)
            {
                writer.WriteStartElement("UniqueValueInfoObj.SerializedValue", Namespaces[Constants.esriMappingPrefix]);
                writeEntityFieldValue(entityFieldValue);
                writer.WriteEndElement();
                return;
            }

            HyperlinkFieldValue hyperlinkFieldValue = uniqueValueInfo as HyperlinkFieldValue;

            if (hyperlinkFieldValue != null)
            {
                writer.WriteStartElement("UniqueValueInfoObj.SerializedValue", Namespaces[Constants.esriMappingPrefix]);
                writeHyperlinkFieldValue(hyperlinkFieldValue);
                writer.WriteEndElement();
                return;
            }

            HyperlinkImageFieldValue hyperlinkImageFieldValue = uniqueValueInfo as HyperlinkImageFieldValue;

            if (hyperlinkImageFieldValue != null)
            {
                writer.WriteStartElement("UniqueValueInfoObj.SerializedValue", Namespaces[Constants.esriMappingPrefix]);
                writeHyperlinkImageFieldValue(hyperlinkImageFieldValue);
                writer.WriteEndElement();
                return;
            }

            LookupFieldValue lookupFieldValue = uniqueValueInfo as LookupFieldValue;

            if (lookupFieldValue != null)
            {
                writer.WriteStartElement("UniqueValueInfoObj.SerializedValue", Namespaces[Constants.esriMappingPrefix]);
                writeLookupFieldValue(lookupFieldValue);
                writer.WriteEndElement();
                return;
            }

            DateTimeFieldValue dateTimeFieldValue = uniqueValueInfo as DateTimeFieldValue;

            if (dateTimeFieldValue != null)
            {
                writer.WriteStartElement("UniqueValueInfoObj.SerializedValue", Namespaces[Constants.esriMappingPrefix]);
                writeDateTimeFieldValue(dateTimeFieldValue);
                writer.WriteEndElement();
                return;
            }

            if (uniqueValueInfo is double)
            {
                writer.WriteAttributeString("SerializedValue", ((double)uniqueValueInfo).ToString(CultureInfo.InvariantCulture));
            }
            else
            {
                writer.WriteAttributeString("SerializedValue", uniqueValueInfo.ToString());
            }
        }
        private void writeNumericFieldValue(NumericFieldValue numericFieldValue)
        {
            if (numericFieldValue == null)
                return;

            writer.WriteStartElement("NumericFieldValue", Namespaces[Constants.esriMappingPrefix]);
            if (!string.IsNullOrEmpty(numericFieldValue.FormattedValue))
                writer.WriteAttributeString("FormattedValue", numericFieldValue.FormattedValue);
            if (!double.IsNaN(numericFieldValue.Value))
                writer.WriteAttributeString("Value", numericFieldValue.Value.ToString(CultureInfo.InvariantCulture));
            writer.WriteEndElement();
        }