Exemple #1
0
        /// <summary>
        /// Retrieves an embedded <see cref="T:Tridion.ContentManager.ContentManagement.Component" /> field value.
        /// </summary>
        /// <param name="itemFields">The <see cref="T:Tridion.ContentManager.ContentManagement.Fields.ItemFields" /> collection.</param>
        /// <param name="fieldName">Fieldname to retrieve</param>
        /// <param name="embeddedFieldName">Embedded field to retrieve</param>
        /// <returns>
        ///   <see cref="T:Tridion.ContentManager.ContentManagement.Component" />
        /// </returns>
        public static Component ComponentValue(this ItemFields itemFields, String fieldName, String embeddedFieldName)
        {
            if (itemFields != null && itemFields.Contains(fieldName))
            {
                return(itemFields.EmbeddedValue(fieldName).ComponentValue(embeddedFieldName));
            }

            return(null);
        }
Exemple #2
0
        /// <summary>
        /// Retrieves embedded <see cref="T:Tridion.ContentManager.ContentManagement.Component" /> field values.
        /// </summary>
        /// <param name="itemFields">The <see cref="T:Tridion.ContentManager.ContentManagement.Fields.ItemFields" /> collection.</param>
        /// <param name="fieldName">Fieldname to retrieve</param>
        /// <param name="embeddedFieldName">Embedded field to retrieve</param>
        /// <returns>
        /// <returns><see cref="T:Tridion.ContentManager.ContentManagement.Component" /> values</returns>
        /// </returns>
        public static IList <Component> ComponentValues(this ItemFields itemFields, String fieldName, String embeddedFieldName)
        {
            if (itemFields != null && itemFields.Contains(fieldName))
            {
                return(itemFields.EmbeddedValue(fieldName).ComponentValues(embeddedFieldName));
            }

            return(new List <Component>());
        }
Exemple #3
0
        /// <summary>
        /// Retrieves an embedded <see cref="T:System.String" /> XML field value.
        /// </summary>
        /// <param name="itemFields">The <see cref="T:Tridion.ContentManager.ContentManagement.Fields.ItemFields" /> collection.</param>
        /// <param name="fieldName">Fieldname to retrieve</param>
        /// <param name="embeddedFieldName">Embedded field to retrieve</param>
        /// <returns>
        ///   <see cref="T:System.String" />
        /// </returns>
        public static String XMLValue(this ItemFields itemFields, String fieldName, String embeddedFieldName)
        {
            if (itemFields != null && itemFields.Contains(fieldName))
            {
                return(itemFields.EmbeddedValue(fieldName).XMLValue(embeddedFieldName));
            }

            return(String.Empty);
        }
Exemple #4
0
        /// <summary>
        /// Retrieves embedded <see cref="T:System.Double" /> field values.
        /// </summary>
        /// <param name="itemFields">The <see cref="T:Tridion.ContentManager.ContentManagement.Fields.ItemFields" /> collection.</param>
        /// <param name="fieldName">Fieldname to retrieve</param>
        /// <param name="embeddedFieldName">embedded field to retrieve</param>
        /// <returns>
        /// <returns><see cref="T:System.Double" /> values</returns>
        /// </returns>
        public static IList <Double> NumberValues(this ItemFields itemFields, String fieldName, String embeddedFieldName)
        {
            if (itemFields != null && itemFields.Contains(fieldName))
            {
                return(itemFields.EmbeddedValue(fieldName).NumberValues(embeddedFieldName));
            }

            return(new List <Double>());
        }
Exemple #5
0
        /// <summary>
        /// Retrieves an embedded <see cref="T:System.Double" /> field value.
        /// </summary>
        /// <param name="itemFields">The <see cref="T:Tridion.ContentManager.ContentManagement.Fields.ItemFields" /> collection.</param>
        /// <param name="fieldName">Fieldname to retrieve</param>
        /// <param name="embeddedFieldName">Embedded field to retrieve</param>
        /// <returns>
        ///   <see cref="T:System.Double" />
        /// </returns>
        public static Double NumberValue(this ItemFields itemFields, String fieldName, String embeddedFieldName)
        {
            if (itemFields != null && itemFields.Contains(fieldName))
            {
                return(itemFields.EmbeddedValue(fieldName).NumberValue(embeddedFieldName));
            }

            return(Double.NaN);
        }
Exemple #6
0
        /// <summary>
        /// Retrieves an embedded <see cref="T:System.DateTime" /> field value.
        /// </summary>
        /// <param name="itemFields">The <see cref="T:Tridion.ContentManager.ContentManagement.Fields.ItemFields" /> collection.</param>
        /// <param name="fieldName">Fieldname to retrieve</param>
        /// <param name="embeddedFieldName">Embedded field to retrieve</param>
        /// <returns>
        ///   <see cref="T:System.DateTime" />
        /// </returns>
        public static DateTime DateValue(this ItemFields itemFields, String fieldName, String embeddedFieldName)
        {
            if (itemFields != null && itemFields.Contains(fieldName))
            {
                return(itemFields.EmbeddedValue(fieldName).DateValue(embeddedFieldName));
            }

            return(default(DateTime));
        }
Exemple #7
0
        /// <summary>
        /// Retrieves embedded <see cref="T:System.String" /> field values.
        /// </summary>
        /// <param name="itemFields">The <see cref="T:Tridion.ContentManager.ContentManagement.Fields.ItemFields" /> collection.</param>
        /// <param name="fieldName">Fieldname to retrieve</param>
        /// <param name="embeddedFieldName">embedded field to retrieve</param>
        /// <returns>
        /// <returns><see cref="T:System.String" /> values</returns>
        /// </returns>
        public static IList <String> ExternalLinkValues(this ItemFields itemFields, String fieldName, String embeddedFieldName)
        {
            if (itemFields != null && itemFields.Contains(fieldName))
            {
                return(itemFields.EmbeddedValue(fieldName).ExternalLinkValues(embeddedFieldName));
            }

            return(new List <String>());
        }