Esempio n. 1
0
 /// <summary>
 /// Expands the value declaration
 /// </summary>
 /// <returns>Returns the expanded values</returns>
 public IList <object> Expand()
 {
     try
     {
         this.ParseDeclaration();
         IList <Transform> transforms = ValueDeclaration.ExtractTransforms(this.TransformsString);
         return(Transform.ExecuteTransformChain(transforms, this.internalDeclaration.ExpandDeclaration()));
     }
     catch (Exception ex)
     {
         throw new DeclarationExpansionException(this.Declaration, string.Empty, ex);
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Expands the value declaration
        /// </summary>
        /// <param name="hologram">The object to obtain the values used in the expansion</param>
        /// <returns>Returns the expanded values</returns>
        public IList <object> Expand(MAObjectHologram hologram)
        {
            try
            {
                this.ParseDeclaration();
                IList <Transform> transforms = ValueDeclaration.ExtractTransforms(this.TransformsString);

                return(Transform.ExecuteTransformChain(transforms, this.internalDeclaration.ExpandDeclaration(hologram)));
            }
            catch (Exception ex)
            {
                throw new DeclarationExpansionException(this.Declaration, hologram.ObjectID.ToString(), ex);
            }
        }
        /// <summary>
        /// Expands the declaration
        /// </summary>
        /// <param name="hologram">The object to use as the source of values during the expansion</param>
        /// <param name="isAttributeValueUnique">A function that can test if the value generated by the expansion is unique</param>
        /// <returns>Returns the expanded values</returns>
        public IList <object> Expand(MAObjectHologram hologram, Func <string, string, bool> isAttributeValueUnique)
        {
            if (!this.parsedDeclaration)
            {
                this.ParseDeclaration();
            }

            IList <Transform> transforms = ValueDeclaration.ExtractTransforms(this.TransformsString);
            List <object>     values     = new List <object>()
            {
                this.ExpandComplexDeclaration(hologram, isAttributeValueUnique)
            };

            return(Transform.ExecuteTransformChain(transforms, values));
        }