コード例 #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);
     }
 }
コード例 #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);
            }
        }
コード例 #3
0
        /// <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));
        }
コード例 #4
0
        /// <summary>
        /// Determines whether an object is equal to this object
        /// </summary>
        /// <param name="obj">The object to compare</param>
        /// <returns>Returns a value indicating if the two objects are equal</returns>
        public override bool Equals(object obj)
        {
            if (obj == null)
            {
                return(false);
            }

            if (obj is ValueDeclaration)
            {
                ValueDeclaration other = (ValueDeclaration)obj;

                if (this.Declaration == other.Declaration && this.TransformsString == other.TransformsString)
                {
                    return(true);
                }
            }

            return(base.Equals(obj));
        }
コード例 #5
0
 /// <summary>
 /// Initializes a new instance of the DBQueryByValue class
 /// </summary>
 /// <param name="searchAttribute">The attribute to search for in the database</param>
 /// <param name="valueOperator">The operator to apply to values in the search</param>
 /// <param name="declaration">The value to search for</param>
 public DBQueryByValue(AcmaSchemaAttribute searchAttribute, ValueOperator valueOperator, ValueDeclaration declaration)
     : this(searchAttribute, valueOperator)
 {
     this.ValueDeclarations.Add(declaration);
 }
コード例 #6
0
 protected override void Initialize()
 {
     base.Initialize();
     this.Arguments = new ValueDeclaration();
 }