Beispiel #1
0
        public override bool Equals(object obj)
        {
            HyperlinkImageFieldValue other = obj as HyperlinkImageFieldValue;

            if (other != null)
            {
                return(ImageUrl == other.ImageUrl && ImageTooltip == other.ImageTooltip);
            }
            return(base.Equals(obj));
        }
Beispiel #2
0
        private void writeHyperlinkImageFieldValue(HyperlinkImageFieldValue hyperlinkImageFieldValue)
        {
            if (hyperlinkImageFieldValue == null)
            {
                return;
            }

            writer.WriteStartElement("HyperlinkImageFieldValue", Namespaces[Constants.esriMappingPrefix]);
            if (!string.IsNullOrEmpty(hyperlinkImageFieldValue.ImageTooltip))
            {
                writer.WriteAttributeString("ImageTooltip", hyperlinkImageFieldValue.ImageTooltip);
            }
            if (!string.IsNullOrEmpty(hyperlinkImageFieldValue.ImageUrl))
            {
                writer.WriteAttributeString("ImageUrl", hyperlinkImageFieldValue.ImageUrl);
            }
            writer.WriteEndElement();
        }
        public static string ExtractHyperlinkValue(object value, bool returnUrl)
        {
            HyperlinkImageFieldValue hyperlinkImageFieldValue = value as HyperlinkImageFieldValue;

            if (hyperlinkImageFieldValue != null)
            {
                return(returnUrl ? hyperlinkImageFieldValue.ImageUrl : hyperlinkImageFieldValue.ImageTooltip);
            }
            else
            {
                EntityFieldValue entityFieldValue = value as EntityFieldValue;
                if (entityFieldValue != null)
                {
                    return(returnUrl ? entityFieldValue.LinkUrl : entityFieldValue.DisplayText);
                }
                else
                {
                    LookupFieldValue lookupFieldValue = value as LookupFieldValue;
                    if (lookupFieldValue != null)
                    {
                        return(returnUrl ? lookupFieldValue.LinkUrl : lookupFieldValue.DisplayText);
                    }
                    else
                    {
                        HyperlinkFieldValue hyperlinkFieldValue = value as HyperlinkFieldValue;
                        if (hyperlinkFieldValue != null)
                        {
                            return(returnUrl ? hyperlinkFieldValue.LinkUrl : hyperlinkFieldValue.DisplayText);
                        }
                        else
                        {
                            return(value as string);
                        }
                    }
                }
            }
        }
Beispiel #4
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 writeHyperlinkImageFieldValue(HyperlinkImageFieldValue hyperlinkImageFieldValue)
        {
            if (hyperlinkImageFieldValue == null)
                return;

            writer.WriteStartElement("HyperlinkImageFieldValue", Namespaces[Constants.esriMappingPrefix]);
            if (!string.IsNullOrEmpty(hyperlinkImageFieldValue.ImageTooltip))
                writer.WriteAttributeString("ImageTooltip", hyperlinkImageFieldValue.ImageTooltip);
            if (!string.IsNullOrEmpty(hyperlinkImageFieldValue.ImageUrl))
                writer.WriteAttributeString("ImageUrl", hyperlinkImageFieldValue.ImageUrl);
            writer.WriteEndElement();
        }