Ejemplo n.º 1
0
        /// <summary>
        /// Returns a unique identifier for the <see cref="ConstructorMember"/>.
        /// </summary>
        /// <returns>A unique <see cref="System.String"/> pertinent to the
        /// <see cref="ConstructorMember"/>.</returns>
        public override string GetUniqueIdentifier()
        {
            string signature = this.Name;
            IConstructorParameterMembers parameters = this.Parameters;

            /* *
             * Add the parameters, use the parameter type information to yield a type-signature.
             * Names aren't as important because they are more likely to repeat in a type-strict
             * system that translates various types into an common understanding underneath.
             * */
            if (parameters.Count > 0)
            {
                string[] names = new string[parameters.Count];
                for (int i = 0; i < parameters.Count; i++)
                {
                    /* *
                     * ToDo: Add 'GetTypeName' to type-references, stand-alone types
                     * may not contain necessary type-arguments.
                     * */
                    names[i] = parameters.Values[i].ParameterType.TypeInstance.
                               GetTypeName(CodeGeneratorHelper.DefaultDomOptions);
                }
                signature += string.Format("({0})", string.Join(", ", names));
                ;
            }
            else
            {
                signature += "()";
            }
            return(signature);
        }
Ejemplo n.º 2
0
 public virtual void TranslateParameters(IConstructorParameterMembers ctorParameters)
 {
     TranslateParameters <IConstructorParameterMember, CodeConstructor, IMemberParentType>(ctorParameters);
 }