Esempio n. 1
0
        /// <summary>
        ///		Obtiene el prototipo de un método Get o Set de una propiedad
        /// </summary>
        private string GetPropertyMethodPrototype(LanguageStructModel.ModifierType intModifier, MethodModel objMethod, string strMethodName)
        {
            string strPrototype = "";

            // Añade los datos al prototipo
            if (objMethod != null)
            {                                     // Añade el modificador (si es distinto al de la propiedad, es decir: public Property { private set }
                if (intModifier != objMethod.Modifier)
                {
                    strPrototype += GetModifierText(objMethod.Modifier);
                }
                // Añade el nombre
                strPrototype = strPrototype.AddWithSeparator(strMethodName + ";", " ", false);
            }
            // Devuelve el prototipo
            return(strPrototype);
        }
        /// <summary>
        ///		Obtiene el prototipo de un método Get o Set de una propiedad
        /// </summary>
        private MLNodesCollection GetPropertyMethodPrototype(LanguageStructModel.ModifierType intModifier, MethodModel objMethod, string strMethodName)
        {
            MLNodesCollection objColMLNodes = new MLNodesCollection();

            // Añade los datos al prototipo
            if (objMethod != null)
            {                                     // Añade el modificador (si es distinto al de la propiedad, es decir: public Property { private set }
                if (intModifier != objMethod.Modifier)
                {
                    objColMLNodes.Add(Document.MLBuilder.GetSpan(GetModifierText(objMethod.Modifier)));
                }
                // Añade el nombre
                objColMLNodes.Add(Document.MLBuilder.GetSpan(strMethodName + ";"));
            }
            // Devuelve el prototipo
            return(objColMLNodes);
        }
Esempio n. 3
0
        /// <summary>
        ///		Obtiene el prototipo de un método Get o Set de una propiedad
        /// </summary>
        private string GetPropertyMethodPrototype(LanguageStructModel.ModifierType modifier, MethodModel method, string methodName)
        {
            string prototype = string.Empty;

            // Añade los datos al prototipo
            if (method != null)
            {
                // Añade el modificador (si es distinto al de la propiedad, es decir: public Property { private set }
                if (modifier != method.Modifier)
                {
                    prototype += GetModifierText(method.Modifier) + " ";
                }
                // Añade el nombre
                prototype = methodName + ";";
            }
            // Devuelve el prototipo
            return(prototype);
        }
Esempio n. 4
0
        /// <summary>
        ///		Obtiene el texto del modificador
        /// </summary>
        private string GetModifierText(LanguageStructModel.ModifierType modifier)
        {
            switch (modifier)
            {
            case LanguageStructModel.ModifierType.Private:
                return("private");

            case LanguageStructModel.ModifierType.Protected:
                return("protected");

            case LanguageStructModel.ModifierType.Internal:
                return("internal");

            case LanguageStructModel.ModifierType.ProtectedAndInternal:
            case LanguageStructModel.ModifierType.ProtectedOrInternal:
                return("protected internal");

            case LanguageStructModel.ModifierType.Public:
                return("public");

            default:
                return(string.Empty);
            }
        }