/// <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); }
/// <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); }
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(); } }
/// <summary> /// Adds an Svg to the body footer /// </summary> /// <param name="pdfMakeSvg"></param> public void AddFooterSvg(IPdfMakeSvg pdfMakeSvg) { Footer.Add(pdfMakeSvg); }
/// <summary> /// Adds an image to the footer section /// </summary> /// <param name="pdfMakeImage"></param> public void AddFooterImage(IPdfMakeImage pdfMakeImage) { Footer.Add(pdfMakeImage); }
/// <summary> /// Adds a stack to the footer section /// </summary> /// <param name="pdfMakeStacks"></param> public void AddFooterStack <T>(IPdfMakeStack <T> pdfMakeStacks) { Footer.Add(new { pdfMakeStacks }); }
/// <summary> /// Adds a unordered IList to the footer section /// </summary> /// <param name="pdfMakeUnorderedList"></param> public void AddFooterUnorderedList <T>(IPdfMakeUnorderedList <T> pdfMakeUnorderedList) { Footer.Add(pdfMakeUnorderedList); }
/// <summary> /// Adds a table to the footer section /// </summary> /// <param name="pdfMakeTable"></param> public void AddFooterTable <T>(IPdfMakeTable <T> pdfMakeTable) { Footer.Add(pdfMakeTable); }
/// <summary> /// Adds a columns to the footer section /// </summary> /// <param name="Columns"></param> public void AddFooterColumns <T>(IPdfMakeColumns <T> Columns) { Footer.Add(Columns); }
/// <summary> /// Adds a unordered IList to the footer section /// </summary> /// <param name="pdfMakeUnorderedList"></param> public void AddFooterUnorderedList(PdfMakeUnorderedList <object> pdfMakeUnorderedList) { Footer.Add(pdfMakeUnorderedList); }
/// <summary> /// Adds a string to the footer section /// </summary> /// <param name="text"></param> public void AddFooterText(string text) { Footer.Add(text); }
/// <summary> /// Adds a IList of string to the footer section /// </summary> /// <param name="text"></param> public void AddFooterText(IEnumerable <string> texts) { Footer.Add(texts); }
/// <summary> /// Adds a qr code to the footer section /// </summary> /// <param name="qRCode"></param> public void AddFooterQRCode(IPdfMakeQRCode qRCode) { Footer.Add(qRCode); }
/// <summary> /// Add a PdfMake element the footer section /// </summary> /// <param name="pdfmakeObject"></param> public void AddFooter <T>(T pdfmakeObject) { Footer.Add(pdfmakeObject); }
/// <summary> /// Adds a stack to the footer section /// </summary> /// <param name="pdfMakeStacks"></param> public void AddFooterStack(PdfMakeStack <object> pdfMakeStacks) { Footer.Add(new { pdfMakeStacks }); }
/// <summary> /// Adds a link to the footer section /// </summary> /// <param name="pdfMakeLink"></param> public void AddFooterLink(IPdfMakeLink pdfMakeLink) { Footer.Add(pdfMakeLink); }
/// <summary> /// Adds a columns to the footer section /// </summary> /// <param name="Columns"></param> public void AddFooterColumns(PdfMakeColumns <object> Columns) { Footer.Add(Columns); }
/// <summary> /// Adds a text to the footer section /// </summary> /// <param name="PdfMakeText"></param> public void AddFooterText(IPdfMakeText PdfMakeText) { Footer.Add(PdfMakeText); }
/// <summary> /// Adds a table to the footer section /// </summary> /// <param name="pdfMakeTable"></param> public void AddFooterTable(PdfMakeTable <object> pdfMakeTable) { Footer.Add(pdfMakeTable); }
/// <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); }
/// <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 }); }