/// <summary>
 /// Set picture metadata descriptions.
 /// </summary>
 /// <param name="pictureMetaDataDescriptions">Picture metadata descriptions.</param>
 /// <param name="isoCode">Language ISO code.</param>
 protected override void SetPictureMetaDataDescriptions(PictureMetaDataDescriptionList pictureMetaDataDescriptions, String isoCode)
 {
     lock (this)
     {
         base.SetPictureMetaDataDescriptions(pictureMetaDataDescriptions, isoCode);
     }
 }
 /// <summary>
 /// Set picture metadata descriptions.
 /// </summary>
 /// <param name="pictureMetaDataDescriptions">Picture metadata descriptions.</param>
 /// <param name="isoCode">language ISO code</param>
 protected virtual void SetPictureMetaDataDescriptions(PictureMetaDataDescriptionList pictureMetaDataDescriptions, string isoCode)
 {
     if (PictureMetaDataDescriptions == null)
     {
         PictureMetaDataDescriptions = new Dictionary <string, PictureMetaDataDescriptionList>();
     }
     PictureMetaDataDescriptions.Add(isoCode, pictureMetaDataDescriptions);
 }
Ejemplo n.º 3
0
        public void GetPictureInformationById_With_Empty_MetaDataList()
        {
            List <int>                     metaData                    = new List <int>();
            IPictureInformation            pictureInformation          = GetPictureManager(true).GetPictureInformation(GetUserContext(), 0, null, null, metaData);
            PictureMetaDataDescriptionList pictureMetaDataDescriptions = GetMetadataManager(true).GetPictureMetaDataDescriptions(GetUserContext());

            Assert.IsNull(pictureInformation);
            Assert.IsNotNull(pictureMetaDataDescriptions);
            Assert.IsTrue(pictureMetaDataDescriptions.IsNotEmpty());
        }
        /// <summary>
        /// Get all picture metadata descriptions.
        /// </summary>
        /// <param name="isoCode">language ISO code.</param>
        /// <returns>All picture metadata descriptions.</returns>
        protected virtual PictureMetaDataDescriptionList GetPictureMetaDataDescriptions(string isoCode)
        {
            PictureMetaDataDescriptionList pictureMetaDataDescriptions = null;

            if (PictureMetaDataDescriptions != null)
            {
                PictureMetaDataDescriptions.TryGetValue(isoCode, out pictureMetaDataDescriptions);
            }

            return(pictureMetaDataDescriptions);
        }
        /// <summary>
        /// Retrieve all picture metadata descriptions.
        /// </summary>
        /// <param name="userContext">User context.</param>
        /// <returns>Picture metadata descriptions.</returns>
        public override PictureMetaDataDescriptionList GetPictureMetaDataDescriptions(IUserContext userContext)
        {
            PictureMetaDataDescriptionList pictureMetaDataDescriptions = GetPictureMetaDataDescriptions(userContext.Locale.ISOCode);

            if (pictureMetaDataDescriptions.IsNull())
            {
                pictureMetaDataDescriptions = base.GetPictureMetaDataDescriptions(userContext);
                SetPictureMetaDataDescriptions(pictureMetaDataDescriptions, userContext.Locale.ISOCode);
            }

            return(pictureMetaDataDescriptions);
        }