Exemple #1
0
        // Funciones para el recorrido recursivo en profundidad de la jerarquia
        // del árbol de archivos (vinculación dinámica múltiple frustrada)

        public void Imprimir(Categoría cat)
        {
            // Admite varios niveles como secciones de LaTeX

            string sección = "subsubsection";

            switch (nivel)
            {
            case 0:
                sección = "section";
                break;

            case 1:
                sección = "subsection";
                break;
            }

            nivel++;

            tex.WriteLine(@"\" + sección + "{" + cat.Nombre + "}");

            // Imprime recursivamente

            foreach (var elem in cat.Elementos)
            {
                Imprimir(elem);
            }

            nivel--;
        }
        public static bool InsertarCategoría(string Nombre, string Cod_Categoría)
        {
            Categoría obj = new Categoría();

            obj.Nombre1        = Nombre;
            obj.Cod_Categoría1 = Cod_Categoría;
            return(obj.InsertarDocente(obj));
        }
Exemple #3
0
        private void Enumerar(Categoría cat, StreamWriter sw)
        {
            if (cat.Elementos.Length == 0)
            {
                return;
            }

            sw.WriteLine(String.Format(@"<tr><td colspan=""3"" style=""text-align: center;{0}font-weight: {1};"">{2}</td></tr>",
                                       nivel == 0 ? "font-variant: small-caps; " : (nivel == 2 ? "font-style: italic;" : ""),
                                       nivel > 1 ? "normal" : "bold",
                                       cat.Nombre
                                       ));

            nivel++;

            foreach (NodoMapa nodo in cat.Elementos)
            {
                Enumerar(nodo, sw);
            }

            nivel--;
        }