コード例 #1
0
        /// <summary>
        /// Inicializa uma nova instância da classe <see cref="Spartacus.Utils.FileExplorer"/>.
        /// </summary>
        /// <param name='p_root'>
        /// Pasta raiz do explorador de arquivos.
        /// </param>
        /// <param name='p_pathseparator'>
        /// Separador de diretórios.
        /// </param>
        public FileExplorer(string p_root, Spartacus.Utils.PathSeparator p_pathseparator)
        {
            this.v_root = p_root;
            this.v_pathseparator = p_pathseparator;
            this.v_current = new Spartacus.Utils.File(0, 0, Spartacus.Utils.FileType.DIRECTORY, this.v_root, this.v_pathseparator);
            this.v_currentlevel = 0;
            this.v_protectedminlevel = -1; // proteção a princípio está desabilitada

            this.v_showpatterntype = Spartacus.Utils.ShowPatternType.SHOWALL; // padrão é mostrar todos os arquivos
            this.v_protectpattern = "";
            this.v_showhiddenfiles = false; // padrão é não mostrar arquivos e pastas ocultos

            this.v_current.v_protected = true; // raiz sempre é protegida

            this.v_files = new System.Collections.ArrayList();

            this.v_returnhistory = new System.Collections.ArrayList();
            this.v_returnhistory_font = new PDFjet.NET.Font(PDFjet.NET.CoreFont.HELVETICA);
            this.v_returnhistory_font.SetSize(12.0);
            this.v_returnhistory_root = "Diretorio Raiz";
            this.v_returnhistory_sep = " > ";
            this.v_returnhistory_first = "...";
            this.v_returnhistory_maxwidth = 800.0;

            this.v_returnhistory.Add(p_root);
        }
コード例 #2
0
        /// <summary>
        /// Converte a fonte em uma opção específica da PDFjet.
        /// </summary>
        /// <returns>Fonte conforme PDFjet.</returns>
        /// <param name="p_pdf">Objeto PDF.</param>
        public PDFjet.NET.Font GetFont(PDFjet.NET.PDF p_pdf)
        {
            PDFjet.NET.Font v_font = null;

            switch (this.v_family)
            {
                case Spartacus.Reporting.FontFamily.COURIER:
                    if (this.v_bold && this.v_italic)
                    {
                        v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.COURIER_BOLD_OBLIQUE);
                        //this.v_nativefont = new System.Drawing.Font("Courier New", (float) this.v_size, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic);
                    }
                    if (this.v_bold && !this.v_italic)
                    {
                        v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.COURIER_BOLD);
                        //this.v_nativefont = new System.Drawing.Font("Courier New", (float) this.v_size, System.Drawing.FontStyle.Bold);
                    }
                    if (!this.v_bold && this.v_italic)
                    {
                        v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.COURIER_OBLIQUE);
                        //this.v_nativefont = new System.Drawing.Font("Courier New", (float) this.v_size, System.Drawing.FontStyle.Italic);
                    }
                    if (!this.v_bold && !this.v_italic)
                    {
                        v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.COURIER);
                        //this.v_nativefont = new System.Drawing.Font("Courier New", (float) this.v_size, System.Drawing.FontStyle.Regular);
                    }
                    break;
                case Spartacus.Reporting.FontFamily.HELVETICA:
                    if (this.v_bold && this.v_italic)
                    {
                        v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.HELVETICA_BOLD_OBLIQUE);
                        //this.v_nativefont = new System.Drawing.Font("Helvetica", (float) this.v_size, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic);
                    }
                    if (this.v_bold && !this.v_italic)
                    {
                        v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.HELVETICA_BOLD);
                        //this.v_nativefont = new System.Drawing.Font("Helvetica", (float) this.v_size, System.Drawing.FontStyle.Bold);
                    }
                    if (!this.v_bold && this.v_italic)
                    {
                        v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.HELVETICA_OBLIQUE);
                        //this.v_nativefont = new System.Drawing.Font("Helvetica", (float) this.v_size, System.Drawing.FontStyle.Italic);
                    }
                    if (!this.v_bold && !this.v_italic)
                    {
                        v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.HELVETICA);
                        //this.v_nativefont = new System.Drawing.Font("Helvetica", (float) this.v_size, System.Drawing.FontStyle.Regular);
                    }
                    break;
                case Spartacus.Reporting.FontFamily.TIMES:
                    if (this.v_bold && this.v_italic)
                    {
                        v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.TIMES_BOLD_ITALIC);
                        //this.v_nativefont = new System.Drawing.Font("Times New Roman", (float) this.v_size, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic);
                    }
                    if (this.v_bold && !this.v_italic)
                    {
                        v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.TIMES_BOLD);
                        //this.v_nativefont = new System.Drawing.Font("Times New Roman", (float) this.v_size, System.Drawing.FontStyle.Bold);
                    }
                    if (!this.v_bold && this.v_italic)
                    {
                        v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.TIMES_ITALIC);
                        //this.v_nativefont = new System.Drawing.Font("Times New Roman", (float) this.v_size, System.Drawing.FontStyle.Italic);
                    }
                    if (!this.v_bold && !this.v_italic)
                    {
                        v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.TIMES_ROMAN);
                        //this.v_nativefont = new System.Drawing.Font("Times New Roman", (float) this.v_size, System.Drawing.FontStyle.Regular);
                    }
                    break;
                default:
                    break;
            }

            v_font.SetSize(this.v_size);

            return v_font;
        }
コード例 #3
0
        /// <summary>
        /// Initializa uma nova instância da classe <see cref="Spartacus.Utils.FileExplorer"/>.
        /// </summary>
        public FileExplorer()
        {
            this.v_root = null;
            this.v_pathseparator = Spartacus.Utils.PathSeparator.SLASH;
            this.v_currentlevel = 0;
            this.v_protectedminlevel = -1; // proteção a princípio está desabilitada

            this.v_showpatterntype = Spartacus.Utils.ShowPatternType.SHOWALL; // padrão é mostrar todos os arquivos
            this.v_protectpattern = "";
            this.v_showhiddenfiles = false; // padrão é não mostrar arquivos e pastas ocultos

            this.v_files = new System.Collections.ArrayList();

            this.v_returnhistory = new System.Collections.ArrayList();
            this.v_returnhistory_font = new PDFjet.NET.Font(PDFjet.NET.CoreFont.HELVETICA);
            this.v_returnhistory_font.SetSize(12.0);
            this.v_returnhistory_root = "Diretorio Raiz";
            this.v_returnhistory_sep = " > ";
            this.v_returnhistory_first = "...";
            this.v_returnhistory_maxwidth = 800.0;
        }
コード例 #4
0
        /// <summary>
        /// Converte a fonte em uma opção específica da PDFjet.
        /// </summary>
        /// <returns>Fonte conforme PDFjet.</returns>
        /// <param name="p_pdf">Objeto PDF.</param>
        public PDFjet.NET.Font GetFont(PDFjet.NET.PDF p_pdf)
        {
            PDFjet.NET.Font v_font = null;

            switch (this.v_family)
            {
            case Spartacus.Reporting.FontFamily.COURIER:
                if (this.v_bold && this.v_italic)
                {
                    v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.COURIER_BOLD_OBLIQUE);
                    //this.v_nativefont = new System.Drawing.Font("Courier New", (float) this.v_size, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic);
                }
                if (this.v_bold && !this.v_italic)
                {
                    v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.COURIER_BOLD);
                    //this.v_nativefont = new System.Drawing.Font("Courier New", (float) this.v_size, System.Drawing.FontStyle.Bold);
                }
                if (!this.v_bold && this.v_italic)
                {
                    v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.COURIER_OBLIQUE);
                    //this.v_nativefont = new System.Drawing.Font("Courier New", (float) this.v_size, System.Drawing.FontStyle.Italic);
                }
                if (!this.v_bold && !this.v_italic)
                {
                    v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.COURIER);
                    //this.v_nativefont = new System.Drawing.Font("Courier New", (float) this.v_size, System.Drawing.FontStyle.Regular);
                }
                break;

            case Spartacus.Reporting.FontFamily.HELVETICA:
                if (this.v_bold && this.v_italic)
                {
                    v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.HELVETICA_BOLD_OBLIQUE);
                    //this.v_nativefont = new System.Drawing.Font("Helvetica", (float) this.v_size, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic);
                }
                if (this.v_bold && !this.v_italic)
                {
                    v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.HELVETICA_BOLD);
                    //this.v_nativefont = new System.Drawing.Font("Helvetica", (float) this.v_size, System.Drawing.FontStyle.Bold);
                }
                if (!this.v_bold && this.v_italic)
                {
                    v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.HELVETICA_OBLIQUE);
                    //this.v_nativefont = new System.Drawing.Font("Helvetica", (float) this.v_size, System.Drawing.FontStyle.Italic);
                }
                if (!this.v_bold && !this.v_italic)
                {
                    v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.HELVETICA);
                    //this.v_nativefont = new System.Drawing.Font("Helvetica", (float) this.v_size, System.Drawing.FontStyle.Regular);
                }
                break;

            case Spartacus.Reporting.FontFamily.TIMES:
                if (this.v_bold && this.v_italic)
                {
                    v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.TIMES_BOLD_ITALIC);
                    //this.v_nativefont = new System.Drawing.Font("Times New Roman", (float) this.v_size, System.Drawing.FontStyle.Bold | System.Drawing.FontStyle.Italic);
                }
                if (this.v_bold && !this.v_italic)
                {
                    v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.TIMES_BOLD);
                    //this.v_nativefont = new System.Drawing.Font("Times New Roman", (float) this.v_size, System.Drawing.FontStyle.Bold);
                }
                if (!this.v_bold && this.v_italic)
                {
                    v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.TIMES_ITALIC);
                    //this.v_nativefont = new System.Drawing.Font("Times New Roman", (float) this.v_size, System.Drawing.FontStyle.Italic);
                }
                if (!this.v_bold && !this.v_italic)
                {
                    v_font = new PDFjet.NET.Font(p_pdf, PDFjet.NET.CoreFont.TIMES_ROMAN);
                    //this.v_nativefont = new System.Drawing.Font("Times New Roman", (float) this.v_size, System.Drawing.FontStyle.Regular);
                }
                break;

            default:
                break;
            }

            v_font.SetSize(this.v_size);

            return(v_font);
        }