Inheritance: IXmlSerializable
Example #1
0
        private string GetLinkOrNull(MD_Keyword keywordElement)
        {
            string keywordLink = null;

            var keyword = keywordElement.keyword;

            if (keyword.GetType() == typeof(Anchor_Type))
            {
                Anchor_Type anchor = keyword as Anchor_Type;
                if (anchor != null)
                {
                    keywordLink = anchor.href;
                }
            }

            return keywordLink;
        }
Example #2
0
        private string GetStringOrNull(MD_Keyword keywordElement)
        {
            string keywordValue = null;

            var keyword = keywordElement.keyword;

            if (keyword.GetType() == typeof(PT_FreeText_PropertyType))
            {
                CharacterString_PropertyType charString = keyword as CharacterString_PropertyType;
                if (charString != null)
                {
                    keywordValue = charString.CharacterString;
                }
            }
            else if (keyword.GetType() == typeof(CharacterString_PropertyType))
            {
                CharacterString_PropertyType charString = keyword as CharacterString_PropertyType;
                if (charString != null)
                {
                    keywordValue = charString.CharacterString;
                }
            }
            else if (keyword.GetType() == typeof(Anchor_Type))
            {
                Anchor_Type anchor = keyword as Anchor_Type;
                if (anchor != null)
                {
                    keywordValue = anchor.Value;
                }
            }

            return keywordValue;
        }
Example #3
0
        private string GetEnglishValueFromFreeText(MD_Keyword input)
        {
            string value = null;

            var keyword = input.keyword;
            if (keyword != null)
            {
                PT_FreeText_PropertyType freeText = keyword as PT_FreeText_PropertyType;
                if (freeText != null && freeText.PT_FreeText != null && freeText.PT_FreeText.textGroup != null)
                {
                    foreach (var localizedStringProperty in freeText.PT_FreeText.textGroup)
                    {
                        if (localizedStringProperty.LocalisedCharacterString != null
                            && localizedStringProperty.LocalisedCharacterString.locale != null
                            && localizedStringProperty.LocalisedCharacterString.locale.ToUpper().Equals(LOCALE_LINK_ENG))
                        {
                            value = localizedStringProperty.LocalisedCharacterString.Value;
                            break;
                        }
                    }
                }
            }
            return value;
        }