Exemplo n.º 1
0
        /// <summary>
        /// Reads the text and stores it in lists of lines
        /// </summary>
        /// <param name="name">File to load</param>
        protected override void ReadText(string name)
        {
            Data = new Parser.BBSCodeResult();
            List <string> txt;

            if (TextHelper.IsUrl(name))
            {
                WebClient webClient = new WebClient();
                txt = TextHelper.SplitString(webClient.DownloadString(name));
            }
            else
            {
                txt = File.ReadAllLines(GetFile(name)).ToList();
            }

            foreach (string s in txt)
            {
                if (s.Length <= client.screenWidth)
                {
                    Text.Add(s);
                }
                else
                {
                    Text.AddRange(TextHelper.WordWrap(s, client.screenWidth));
                }
            }
            Footer.Add(string.Empty);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Reads the markdown file and stores it in lists of lines
        /// </summary>
        /// <param name="name">File to load</param>
        protected override void ReadText(string name)
        {
            Data = new Parser.BBSCodeResult();
            string txt;

            if (TextHelper.IsUrl(name))
            {
                WebClient webClient = new WebClient();
                txt = webClient.DownloadString(name);
                Uri dir = new Uri(new Uri(name), ".");
                basePath = dir.OriginalString;
            }
            else
            {
                txt      = File.ReadAllText(GetFile(name));
                basePath = Path.GetDirectoryName(name);
            }

            MarkdownDocument md = new MarkdownDocument();

            md.Parse(txt);

            mdStyles = (NameValueCollection)ConfigurationManager.GetSection("Markdown");
            foreach (var b in md.Blocks)
            {
                Text.AddRange(BlockProcessing(b, 0));
            }
            Footer.Add(string.Empty);
        }
Exemplo n.º 3
0
    private void Insert()
    {
        Data objdata = new Data(Global.ConnectionSql);

        try
        {
            Footer obj = new Footer();
            obj.DataObject  = objdata;
            obj.Title       = txtTitle.Text.Trim();
            obj.Description = radContents.Content;
            if (this.uplImage.HasFile)
            {
                //Neodynamic.WebControls.ImageDraw.ImageElement uploadedImage;
                //uploadedImage = Neodynamic.WebControls.ImageDraw.ImageElement.FromBinary(this.uplImage.FileBytes);
                //Neodynamic.WebControls.ImageDraw.Resize actResize = new Neodynamic.WebControls.ImageDraw.Resize();
                //actResize.Width = 150;
                //actResize.Height = 150;
                //uploadedImage.Actions.Add(actResize);
                //Neodynamic.WebControls.ImageDraw.ImageDraw imgDraw = new Neodynamic.WebControls.ImageDraw.ImageDraw();
                //imgDraw.Elements.Add(uploadedImage);
                //imgDraw.ImageFormat = Neodynamic.WebControls.ImageDraw.ImageDrawFormat.Jpeg;
                //imgDraw.JpegCompressionLevel = 90;
                string filename = GetDate + "_" + uplImage.FileName;
                //imgDraw.Save(Server.MapPath(Global.GetConfigKey("uploadnews") + filename));
                obj.Image = Global.GetConfigKey("uploadnews") + filename;
            }
            else
            {
                obj.Image = Global.GetConfigKey("uploadnews") + "alternate.png";
            }
            int result = Convert.ToInt32(obj.Add());
            if (result > 0)// no error
            {
                Response.Write("<script>window.location='footer.aspx'</script>");
            }
            else if (result == 0)
            {
                lblMessage.Text = "Trùng dữ liệu vui lòng kiểm tra lại";
                return;
            }
            else
            {
                lblMessage.Text = "Lỗi xảy ra trong quá trình lưu dữ liệu. Liên hệ với người quản trị để khắc phục";
                return;
            }
        }
        catch (Exception ex)
        {
            Global.WriteLogError("Insert() " + ex);
            return;
        }
        finally
        {
            objdata.DeConnect();
        }
    }
Exemplo n.º 4
0
 /// <summary>
 /// Adds an Svg to the body footer
 /// </summary>
 /// <param name="pdfMakeSvg"></param>
 public void AddFooterSvg(IPdfMakeSvg pdfMakeSvg)
 {
     Footer.Add(pdfMakeSvg);
 }
Exemplo n.º 5
0
 /// <summary>
 /// Adds an image to the footer section
 /// </summary>
 /// <param name="pdfMakeImage"></param>
 public void AddFooterImage(IPdfMakeImage pdfMakeImage)
 {
     Footer.Add(pdfMakeImage);
 }
Exemplo n.º 6
0
 /// <summary>
 /// Adds a stack to the footer section
 /// </summary>
 /// <param name="pdfMakeStacks"></param>
 public void AddFooterStack <T>(IPdfMakeStack <T> pdfMakeStacks)
 {
     Footer.Add(new { pdfMakeStacks });
 }
Exemplo n.º 7
0
 /// <summary>
 /// Adds a unordered IList to the footer section
 /// </summary>
 /// <param name="pdfMakeUnorderedList"></param>
 public void AddFooterUnorderedList <T>(IPdfMakeUnorderedList <T> pdfMakeUnorderedList)
 {
     Footer.Add(pdfMakeUnorderedList);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Adds a table to the footer section
 /// </summary>
 /// <param name="pdfMakeTable"></param>
 public void AddFooterTable <T>(IPdfMakeTable <T> pdfMakeTable)
 {
     Footer.Add(pdfMakeTable);
 }
Exemplo n.º 9
0
 /// <summary>
 /// Adds a columns to the footer section
 /// </summary>
 /// <param name="Columns"></param>
 public void AddFooterColumns <T>(IPdfMakeColumns <T> Columns)
 {
     Footer.Add(Columns);
 }
Exemplo n.º 10
0
 /// <summary>
 /// Adds a unordered IList to the footer section
 /// </summary>
 /// <param name="pdfMakeUnorderedList"></param>
 public void AddFooterUnorderedList(PdfMakeUnorderedList <object> pdfMakeUnorderedList)
 {
     Footer.Add(pdfMakeUnorderedList);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Adds a string to the footer section
 /// </summary>
 /// <param name="text"></param>
 public void AddFooterText(string text)
 {
     Footer.Add(text);
 }
Exemplo n.º 12
0
 /// <summary>
 /// Adds a IList of string to the footer section
 /// </summary>
 /// <param name="text"></param>
 public void AddFooterText(IEnumerable <string> texts)
 {
     Footer.Add(texts);
 }
Exemplo n.º 13
0
 /// <summary>
 /// Adds a qr code to the footer section
 /// </summary>
 /// <param name="qRCode"></param>
 public void AddFooterQRCode(IPdfMakeQRCode qRCode)
 {
     Footer.Add(qRCode);
 }
Exemplo n.º 14
0
 /// <summary>
 /// Add a PdfMake element the footer section
 /// </summary>
 /// <param name="pdfmakeObject"></param>
 public void AddFooter <T>(T pdfmakeObject)
 {
     Footer.Add(pdfmakeObject);
 }
Exemplo n.º 15
0
 /// <summary>
 /// Adds a stack to the footer section
 /// </summary>
 /// <param name="pdfMakeStacks"></param>
 public void AddFooterStack(PdfMakeStack <object> pdfMakeStacks)
 {
     Footer.Add(new { pdfMakeStacks });
 }
Exemplo n.º 16
0
 /// <summary>
 /// Adds a link to the footer section
 /// </summary>
 /// <param name="pdfMakeLink"></param>
 public void AddFooterLink(IPdfMakeLink pdfMakeLink)
 {
     Footer.Add(pdfMakeLink);
 }
Exemplo n.º 17
0
 /// <summary>
 /// Adds a columns to the footer section
 /// </summary>
 /// <param name="Columns"></param>
 public void AddFooterColumns(PdfMakeColumns <object> Columns)
 {
     Footer.Add(Columns);
 }
Exemplo n.º 18
0
 /// <summary>
 /// Adds a text to the footer section
 /// </summary>
 /// <param name="PdfMakeText"></param>
 public void AddFooterText(IPdfMakeText PdfMakeText)
 {
     Footer.Add(PdfMakeText);
 }
Exemplo n.º 19
0
 /// <summary>
 /// Adds a table to the footer section
 /// </summary>
 /// <param name="pdfMakeTable"></param>
 public void AddFooterTable(PdfMakeTable <object> pdfMakeTable)
 {
     Footer.Add(pdfMakeTable);
 }
Exemplo n.º 20
0
 /// <summary>
 /// Add a IList of texts to the footer section
 /// </summary>
 /// <param name="PdfMakeTexts"></param>
 public void AddFooterText <T>(IPdfMakeTexts <T> PdfMakeTexts)
 {
     Footer.Add(PdfMakeTexts);
 }
Exemplo n.º 21
0
 /// <summary>
 /// Adds a IList of texts to the footer section
 /// </summary>
 /// <param name="PdfMakeTexts"></param>
 public void AddFooterText(IEnumerable <PdfMakeText> PdfMakeTexts)
 {
     Footer.Add(new { text = PdfMakeTexts });
 }