本文整理汇总了C#中iTextSharp.text.List.Add方法的典型用法代码示例。如果您正苦于以下问题:C# List.Add方法的具体用法?C# List.Add怎么用?C# List.Add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iTextSharp.text.List
的用法示例。
在下文中一共展示了List.Add方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Content
/*
* (non-Javadoc)
*
* @see
* com.itextpdf.tool.xml.ITagProcessor#content(com.itextpdf.tool.xml.Tag,
* java.util.List, com.itextpdf.text.Document, java.lang.String)
*/
public override IList<IElement> Content(IWorkerContext ctx, Tag tag, String content) {
List<Chunk> sanitizedChunks = HTMLUtils.Sanitize(content, false);
List<IElement> l = new List<IElement>(1);
foreach (Chunk sanitized in sanitizedChunks) {
HtmlPipelineContext myctx;
try {
myctx = GetHtmlPipelineContext(ctx);
} catch (NoCustomContextException e) {
throw new RuntimeWorkerException(e);
}
if (tag.CSS.ContainsKey(CSS.Property.TAB_INTERVAL)) {
TabbedChunk tabbedChunk = new TabbedChunk(sanitized.Content);
if (null != GetLastChild(tag) && GetLastChild(tag).CSS.ContainsKey(CSS.Property.XFA_TAB_COUNT)) {
tabbedChunk.TabCount = int.Parse(GetLastChild(tag).CSS[CSS.Property.XFA_TAB_COUNT]);
}
l.Add(GetCssAppliers().Apply(tabbedChunk, tag,myctx));
} else if (null != GetLastChild(tag) && GetLastChild(tag).CSS.ContainsKey(CSS.Property.XFA_TAB_COUNT)) {
TabbedChunk tabbedChunk = new TabbedChunk(sanitized.Content);
tabbedChunk.TabCount = int.Parse(GetLastChild(tag).CSS[CSS.Property.XFA_TAB_COUNT]);
l.Add(GetCssAppliers().Apply(tabbedChunk, tag, myctx));
} else {
l.Add(GetCssAppliers().Apply(sanitized, tag, myctx));
}
}
return l;
}
示例2: ExportCsvChart
/// <summary>
/// 导出csv格式的图表数据
/// </summary>
/// <param name="filename"></param>
/// <param name="serieNo"></param>
/// <returns></returns>
public ActionResult ExportCsvChart(string filename, string serieNo)
{
CsvStreamWriter scvWriter = new CsvStreamWriter();
ChartData chartData = TempDataUtil.getChartData(serieNo);
string reportname = string.Empty;
if (chartData != null)
{
reportname = (filename.Equals("chart") ? "" : filename) + chartData.name.Replace("/", "").Replace(" ", "");
IList<string> dataList = new List<string>();
string xname = Resources.SunResource.CUSTOMREPORT_CHART_TIME;
if (chartData.names.Length > 0 && !string.IsNullOrEmpty(chartData.names[0]))
{
xname = chartData.names[0] + "[" + chartData.units[0] + "]";
}
dataList.Add(xname);
dataList.Add(convertArrtoStr(chartData.categories));
foreach (YData ydata in chartData.series)
{
dataList.Add(ydata.name);
dataList.Add(convertArrtoStr(ydata.data));
}
scvWriter.AddStrDataList(dataList);
}
string fullFile = Server.MapPath("/") + "tempexportfile\\" + serieNo + ".csv";
scvWriter.Save(fullFile);
//转化为csv格式的字符串
ActionResult tmp = File(fullFile, "text/csv; charset=UTF-8", urlcode(reportname) + ".csv");
return tmp;
}
示例3: DefinirPontosIntermediarios
public static void DefinirPontosIntermediarios(string descricao)
{
List<string> tempo = new List<String>();
tempo.Add(DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss.fff"));
tempo.Add(descricao);
pontosIntermediarios.Add(tempo);
}
示例4: Sanitize
/**
* @param str the string to sanitize
* @param trim to trim or not to trim
* @return sanitized string
*/
private static List<Chunk> Sanitize(String str, bool preserveWhiteSpace, bool replaceNonBreakableSpaces) {
StringBuilder builder = new StringBuilder();
StringBuilder whitespaceBuilder = new StringBuilder();
List<Chunk> chunkList = new List<Chunk>();
bool isWhitespace = str.Length > 0 ? IsWhiteSpace(str[0]) : true;
foreach (char c in str) {
if (isWhitespace && !IsWhiteSpace(c)) {
if (builder.Length == 0) {
chunkList.Add(Chunk.CreateWhitespace(builder.ToString(), preserveWhiteSpace));
} else {
builder.Append(" ");
}
whitespaceBuilder = new StringBuilder();
}
isWhitespace = IsWhiteSpace(c);
if (isWhitespace) {
whitespaceBuilder.Append(c);
} else {
builder.Append(c);
}
}
if (builder.Length > 0) {
chunkList.Add(new Chunk(replaceNonBreakableSpaces ? builder.ToString().Replace(Char.ConvertFromUtf32(0x00a0), " ") : builder.ToString()));
}
if (whitespaceBuilder.Length > 0) {
chunkList.Add(Chunk.CreateWhitespace(whitespaceBuilder.ToString(), preserveWhiteSpace));
}
return chunkList;
}
示例5: GetJobs
public List<FilesToGrab> GetJobs()
{
List<FilesToGrab> oListofJobs = new List<FilesToGrab>();
FilesToGrab oAdd5 = new FilesToGrab() { _iPages = 22, _iJobOrder = 0, _sFileName = "CRHC4985120211100829.pdf", _sFileURL = "http://dms/Criminal/2005/CRHC4985120211100829.pdf" };
oListofJobs.Add(oAdd5);
oAdd5 = null;
FilesToGrab oAdd4 = new FilesToGrab() { _iPages = 12, _iJobOrder = 0, _sFileName = "CRHC4974120211100654.pdf", _sFileURL = "http://dms/Criminal/2005/CRHC4974120211100654.pdf" };
oListofJobs.Add(oAdd4);
oAdd4 = null;
FilesToGrab oAdd3 = new FilesToGrab() { _iPages = 91, _iJobOrder = 2, _sFileName = "CRHC4975120211100656.pdf", _sFileURL = "http://dms/Criminal/2005/CRHC4975120211100656.pdf" };
oListofJobs.Add(oAdd3);
oAdd3 = null;
FilesToGrab oAdd1 = new FilesToGrab() { _iPages = 8, _iJobOrder = 0, _sFileName = "CRCR1355121410120242.pdf", _sFileURL = "http://dms/Criminal/1968/CR-Confidential-1968/CRCR1355121410120242.pdf" };
oListofJobs.Add(oAdd1);
oAdd1 = null;
FilesToGrab oAdd2 = new FilesToGrab() { _iPages = 64, _iJobOrder = 1, _sFileName = "CRMHC12011212092243.pdf", _sFileURL = "http://dms/Criminal/1980/CRMHC12011212092243.pdf" };
oListofJobs.Add(oAdd2);
oAdd2 = null;
FilesToGrab oAdd8 = new FilesToGrab() { _iPages = 33, _iJobOrder = 1, _sFileName = "CRHC5639121611091133.pdf", _sFileURL = "http://dms/Criminal/2007/CRHC5639121611091133.pdf" };
oListofJobs.Add(oAdd8);
oAdd8 = null;
FilesToGrab oAdd9 = new FilesToGrab() { _iPages = 89, _iJobOrder = 1, _sFileName = "CRHC5579121511042441.pdf", _sFileURL = "http://dms/Criminal/2007/CRHC5579121511042441.pdf" };
oListofJobs.Add(oAdd9);
oAdd9 = null;
return oListofJobs;
}
示例6: GetForms
public List<FilesToGrab> GetForms()
{
List<FilesToGrab> oList = new List<FilesToGrab>();
FilesToGrab oAdd1 = new FilesToGrab() { _iPages = 26, _sFileName = "Adopt-200.pdf", _sFileURL = "http://www.monterey.courts.ca.gov/Documents/Forms/Court%20Packets/Adopt-200.pdf" };
oList.Add(oAdd1);
FilesToGrab oAdd2 = new FilesToGrab() { _iPages = 6, _sFileName = "ADR.pdf", _sFileURL = "http://www.monterey.courts.ca.gov/Documents/Forms/Court%20Packets/ADR.pdf" };
oList.Add(oAdd2);
FilesToGrab oAdd3 = new FilesToGrab() { _iPages = 14, _sFileName = "CR-180.pdf", _sFileURL = "http://www.monterey.courts.ca.gov/Documents/Forms/Court%20Packets/CR-180.pdf" };
oList.Add(oAdd3);
FilesToGrab oAdd4 = new FilesToGrab() { _iPages = 68, _sFileName = "DV-100.pdf", _sFileURL = "http://www.monterey.courts.ca.gov/Documents/Forms/Court%20Packets/DV-100.pdf" };
oList.Add(oAdd4);
FilesToGrab oAdd5 = new FilesToGrab() { _iPages = 12, _sFileName = "FW-001.pdf", _sFileURL = "http://www.monterey.courts.ca.gov/Documents/Forms/Court%20Packets/FW-001.pdf" };
oList.Add(oAdd5);
FilesToGrab oAdd6 = new FilesToGrab() { _iPages = 22, _sFileName = "SC-100.pdf", _sFileURL = "http://www.monterey.courts.ca.gov/Documents/Forms/Court%20Packets/SC-100.pdf" };
oList.Add(oAdd6);
FilesToGrab oAdd7 = new FilesToGrab() { _iPages = 42, _sFileName = "WV-100.pdf", _sFileURL = "http://www.monterey.courts.ca.gov/Documents/Forms/Court%20Packets/WV-100.pdf" };
//FilesToGrab oAdd8 = new FilesToGrab() { _iPages = 30, _sFileName = "UD-100.pdf", _sFileURL = "http://www.monterey.courts.ca.gov/Documents/Forms/Court%20Packets/UD-100.pdf" };
FilesToGrab oAdd9 = new FilesToGrab() { _iPages = 48, _sFileName = "CH-150.pdf", _sFileURL = "http://www.monterey.courts.ca.gov/Documents/Forms/Court%20Packets/CH-150.pdf" };
FilesToGrab oAdd10 = new FilesToGrab() { _iPages = 58, _sFileName = "FL-800.pdf", _sFileURL = "http://www.monterey.courts.ca.gov/Documents/Forms/Court%20Packets/FL-800.pdf" };
oList.Add(oAdd7);
//oList.Add(oAdd8);
oList.Add(oAdd9);
oList.Add(oAdd10);
return oList;
}
示例7: PdfDocument
public PdfDocument(string documentPath, Rectangle pageSize,
float LeftMargin, float RightMargin, float TopMargin, float BottomMargin)
{
_docPath = documentPath;
_PageSize = pageSize;
_margins = new List<float>(4);
_margins.Add(LeftMargin); //margin left
_margins.Add(RightMargin); //margin right
_margins.Add(TopMargin); //margin top
_margins.Add(BottomMargin); //margin bottom
InitializeDocument();
}
示例8: PdfDocument
public PdfDocument(string documentPath, Rectangle pageSize, float LeftMargin, float RightMargin, float TopMargin, float BottomMargin)
{
Sections = new Queue<Parser.Section>();
_docPath = documentPath;
_PageSize = pageSize;
_margins = new List<float>(4);
_margins.Add(LeftMargin); //margin left
_margins.Add(RightMargin); //margin right
_margins.Add(TopMargin); //margin top
_margins.Add(BottomMargin); //margin bottom
ActualWritePosition = (int)PageSize.Top - (int)_margins[2];
InitializeDocument();
}
示例9: Translate
public static IEnumerable<string> Translate(string word)
{
var list = new List<string>();
var htmlWeb = new HtmlWeb();
var doc = htmlWeb.Load("http://en.pons.com/translate?q=" + word + "&l=enpl&in=&lf=en");
var oneText = GetText(doc, 0);
var twoText = GetText(doc, 1);
var threeText = GetText(doc, 2);
list.Add(oneText);
list.Add(twoText);
list.Add(threeText);
return list;
}
示例10: ManipulatePdf
// ---------------------------------------------------------------------------
/**
* Manipulates a PDF file src with the file dest as result
* @param src the original PDF
*/
public byte[] ManipulatePdf(byte[] src)
{
// Create the reader
PdfReader reader = new PdfReader(src);
int n = reader.NumberOfPages;
using (MemoryStream ms = new MemoryStream())
{
// Create the stamper
using (PdfStamper stamper = new PdfStamper(reader, ms))
{
// Make a list with all the possible actions
actions = new List<PdfAction>();
PdfDestination d;
for (int i = 0; i < n; )
{
d = new PdfDestination(PdfDestination.FIT);
actions.Add(PdfAction.GotoLocalPage(++i, d, stamper.Writer));
}
// Add a navigation table to every page
PdfContentByte canvas;
for (int i = 0; i < n; )
{
canvas = stamper.GetOverContent(++i);
CreateNavigationTable(i, n).WriteSelectedRows(0, -1, 696, 36, canvas);
}
}
return ms.ToArray();
}
}
示例11: SystemHistoryTextual
public ActionResult SystemHistoryTextual()
{
// Get the user
var user = userRepository.GetUserByUsername(User.Identity.Name);
//var allPolls = new List<Poll>();
var allPolls = user.ManagedPolls;
var unique = new List<Poll>();
foreach (Poll poll in allPolls) { if (!unique.Contains(poll)) unique.Add(poll); }
allPolls = unique;
IDictionary<Poll, IList<User>> creatorList = new Dictionary<Poll, IList<User>>();
IDictionary<Poll, int> attendanceList = new Dictionary<Poll, int>();
foreach (var poll in allPolls)
{
// Get poll creators
creatorList.Add(poll, userRepository.GetCreatorsOfPoll(poll));
// Get poll attendance
int attendance = 0;
foreach (var participant in poll.participants)
{
if (participant.attended)
{
attendance += 1;
}
}
attendanceList.Add(poll, attendance);
}
var viewModel = new PollReportViewModel(allPolls, creatorList, attendanceList);
return View(viewModel);
}
示例12: button1_Click
private void button1_Click(object sender, EventArgs e)
{
string fechaInicial = this.fechaInicial.Text;
string fechaFinal = this.fechaFinal.Text;
List<int> usuarios = new List<int>();
foreach (DataGridViewRow item in dataGridView1.Rows)
{
try
{
bool isSelected = (bool)item.Cells["Seleccionar"].Value;
if (isSelected)
{
int idUsuario = (int)item.Cells["idUsuario"].Value;
usuarios.Add(idUsuario);
}
}
catch (Exception ex)
{
}
}
List<Reporte> reportes = logica.getReporte(this.getFechaUSD(this.fechaInicial.Text), this.getFechaUSD(this.fechaFinal.Text), usuarios);
crearPDF(reportes);
}
示例13: GetPatientInformation
public void GetPatientInformation(string voterId)
{
List<Voter> voterList = new List<Voter>();
using (var client = new WebClient())
{
var url = "http://nerdcastlebd.com/web_service/voterdb/index.php/voters/all/format/json";
var jsonString = client.DownloadString(url);
var json = new JavaScriptSerializer().Deserialize<dynamic>(jsonString);
foreach (Dictionary<string, object> voter in json["voters"])
{
Voter aVoter = new Voter();
aVoter.Id = voter["id"].ToString();
aVoter.Name = voter["name"].ToString();
aVoter.Address = voter["address"].ToString();
voterList.Add(aVoter);
}
}
//string jsonStringCollection = "[{\"id\":\"5644309456813\",\"name\":\"Rimi Khanom\",\"address\":\"House no: 12. Road no: 14. Dhanmondi, Dhaka\",\"date_of_birth\":\"1979-01-15\"},{\"id\":\"9509623450915\",\"name\":\"Asif Latif\",\"address\":\"House no: 98. Road no: 14. Katalgonj, Chittagong\",\"date_of_birth\":\"1988-07-11\"},{\"id\":\"1098789543218\",\"name\":\"Rakib Hasan\",\"address\":\"Vill. Shantinagar. Thana: Katalgonj, Faridpur\",\"date_of_birth\":\"1982-04-12\"},{\"id\":\"7865409458659\",\"name\":\"Rumon Sarker\",\"address\":\"Kishorginj\",\"date_of_birth\":\"1970-12-02\"},{\"id\":\"8909854343334\",\"name\":\"Gaji Salah Uddin\",\"address\":\"Chittagong\",\"date_of_birth\":\"1965-06-16\"}]";
//List<Voter> voterList = new JavaScriptSerializer().Deserialize<List<Voter>>(jsonStringCollection);
foreach (var voter in voterList)
{
if (voter.Id.Equals(voterId))
{
nameTextBox.Text = voter.Name;
addressTextBox.Text = voter.Address;
}
}
}
示例14: CheckRevocation
public static int CheckRevocation(PdfPKCS7 pkcs7, X509Certificate signCert, X509Certificate issuerCert, DateTime date)
{
List<BasicOcspResp> ocsps = new List<BasicOcspResp>();
if (pkcs7.Ocsp != null)
ocsps.Add(pkcs7.Ocsp);
OcspVerifier ocspVerifier = new OcspVerifier(null, ocsps);
List<VerificationOK> verification =
ocspVerifier.Verify(signCert, issuerCert, date);
if (verification.Count == 0)
{
List<X509Crl> crls = new List<X509Crl>();
if (pkcs7.CRLs != null)
foreach (X509Crl crl in pkcs7.CRLs)
crls.Add(crl);
CrlVerifier crlVerifier = new CrlVerifier(null, crls);
verification.AddRange(crlVerifier.Verify(signCert, issuerCert, date));
}
if (verification.Count == 0)
{
Console.WriteLine("No se pudo verificar estado de revocación del certificado por CRL ni OCSP");
return CER_STATUS_NOT_VERIFIED;
}
else
{
foreach (VerificationOK v in verification)
Console.WriteLine(v);
return 0;
}
}
示例15: ApiProviderViewPost
public override ApiResponse ApiProviderViewPost(IRequest request)
{
var parentNodeId = new NodeIdentifier(
WebUtility.UrlDecode(request.PostArgs["parent_provider"]),
WebUtility.UrlDecode(request.PostArgs["parent_id"]));
var parentNode = request.UnitOfWork.Nodes.FindById(parentNodeId);
if (parentNode == null)
return new BadRequestApiResponse();
if (parentNode.User.Id != request.UserId)
return new ForbiddenApiResponse();
var results = new List<NodeWithRenderedLink>();
if (string.IsNullOrEmpty(request.PostArgs["text"]))
return new BadRequestApiResponse("Text is not specified");
var newNode = new TextNode
{
DateAdded = DateTime.Now,
Text = request.PostArgs["text"],
User = request.User
};
request.UnitOfWork.Text.Save(newNode);
results.Add(new NodeWithRenderedLink(newNode,
Utilities.CreateLinkForNode(request, parentNode, newNode)));
return new ApiResponse(results, 201, "Nodes added");
}