Ejemplo n.º 1
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="srcSet"></param>
        /// <param name="Defn"></param>
        protected void copyDefinition(TParameterSet srcSet, TParameterDefinition Defn)
        {
            int Idx;

            if ((Defn.bIsScalar()) && (srcSet != null) && (srcSet.bIsDefined(Defn.sFullName)))
            {
                switch (Defn.paramType)
                {
                    case ptyReal: setParam(Defn.sFullName, srcSet.fParam(Defn.sFullName));
                        break;
                    case ptyInt: setParam(Defn.sFullName, srcSet.iParam(Defn.sFullName));
                        break;
                    case ptyBool: setParam(Defn.sFullName, srcSet.bParam(Defn.sFullName));
                        break;
                    case ptyText: setParam(Defn.sFullName, srcSet.sParam(Defn.sFullName));
                        break;
                }
            }
            else if (Defn.bIsScalar())
                setUndefined(Defn.sFullName);
            else
                for (Idx = 0; Idx <= Defn.iCount - 1; Idx++)
                    copyDefinition(srcSet, Defn.item(Idx));
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="subSet"></param>
        /// <param name="Definition"></param>
        /// <returns></returns>
        private bool bDiffers(TParameterSet subSet, TParameterDefinition Definition)
        {
            bool result;

            if (!Definition.bValueDefined())
                result = false;
            else if ((subSet.Parent == null) || (!subSet.Parent.bIsDefined(Definition.sFullName)))
                result = true;
            else
            {
                switch (Definition.paramType)
                {
                    case ptyReal: result = (subSet.fParam(Definition.sFullName) != subSet.Parent.fParam(Definition.sFullName));
                        break;
                    case ptyInt: result = (subSet.iParam(Definition.sFullName) != subSet.Parent.iParam(Definition.sFullName));
                        break;
                    case ptyBool: result = (subSet.bParam(Definition.sFullName) != subSet.Parent.bParam(Definition.sFullName));
                        break;
                    case ptyText: result = (subSet.sParam(Definition.sFullName) != subSet.Parent.sParam(Definition.sFullName));
                        break;
                    default: result = false;
                        break;
                }
            }
            return result;
        }