本文整理汇总了C#中iTextSharp.text.List.AddRange方法的典型用法代码示例。如果您正苦于以下问题:C# List.AddRange方法的具体用法?C# List.AddRange怎么用?C# List.AddRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类iTextSharp.text.List
的用法示例。
在下文中一共展示了List.AddRange方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: BatchPrint
public BatchPrint()
{
InitializeComponent();
Control.CheckForIllegalCrossThreadCalls = false;
if (!Directory.Exists(path))//判断是否存在
{
Directory.CreateDirectory(path);//创建新路径
}
List<string> printer = GetAllPrinter();
foreach (var item in printer)
{
this.cmbPrinter.Items.Add(item);
}
m_SynFileInfoList = new List<string>();
m_SynFileInfoList.AddRange(new string[]
{"Z:\\20141229\\331286\\03169ad6-ad1e-464b-a300-193e66d99d75.jpg",
"Z:\\20141229\\331286\\B.doc",
"Z:\\20141229\\331286\\A.pdf"
}
);
// m_SynFileInfoList.AddRange(new string[]
// {@"file://///10.10.100.52/Resource/20141229/331286/03169ad6-ad1e-464b-a300-193e66d99d75.jpg",
// @"file://///10.10.100.52/Resource/20141229/331286/B.doc",
// @"file://///10.10.100.52/Resource/20141229/331286/A.pdf"
// }
//);
}
示例2: AutoResizeTableColumns
/// <summary>
/// Tries to auto resize the specified table columns.
/// </summary>
/// <param name="table">pdf table</param>
public static void AutoResizeTableColumns(this PdfGrid table)
{
if (table == null) return;
var currentRowWidthsList = new List<float>();
var previousRowWidthsList = new List<float>();
foreach (var row in table.Rows)
{
currentRowWidthsList.Clear();
currentRowWidthsList.AddRange(row.GetCells().Select(cell => cell.GetCellWidth()));
if (!previousRowWidthsList.Any())
{
previousRowWidthsList = new List<float>(currentRowWidthsList);
}
else
{
for (int i = 0; i < previousRowWidthsList.Count; i++)
{
if (previousRowWidthsList[i] < currentRowWidthsList[i])
previousRowWidthsList[i] = currentRowWidthsList[i];
}
}
}
if (previousRowWidthsList.Any())
table.SetTotalWidth(previousRowWidthsList.ToArray());
}
示例3: GetImportedPages
/// <summary>
/// Merge pdf files.
/// </summary>
/// <param name="inFiles">List of file paths to merge.</param>
public IList<PdfImportedPage> GetImportedPages(List<String> inFiles)
{
List<PdfImportedPage> pages = new List<PdfImportedPage>();
{
foreach (string file in inFiles)
{
pages.AddRange(ExtractPagesFromFile(file));
}
}
return pages;
}
示例4: GetFlattenedDestinations
public IEnumerable<INamedDestination> GetFlattenedDestinations(Dictionary<string, object> source)
{
var items = new List<INamedDestination> { _factory.CreateNamedInstanceFor(source) };
if (source.ContainsKey("Kids") && source["Kids"] is IEnumerable<Dictionary<string, object>>)
{
foreach (var kid in (source["Kids"] as IEnumerable<Dictionary<string, object>>))
{
items.AddRange(GetFlattenedDestinations(kid));
}
}
return items;
}
示例5: BuildContent
public override List<PdfContentParameter> BuildContent(EntityDTO dto)
{
this.dto = dto;
List<PdfContentParameter> contents = new List<PdfContentParameter>();
contents.Add(base.CreateTitlePage(this.dto));
contents.Add(base.CreateChangeHistory(this.dto));
contents.Add(base.CreateReviewers(this.dto));
contents.Add(base.CreateApprovers(this.dto));
contents.Add(CreateSubProcessObjective());
contents.Add(CreateRolesAndResponsibility());
contents.Add(CreateSubProcessDependency());
contents.Add(CreateSubProcessDiagramTitle());
contents.Add(CreateActivityOverviewHeader());
contents.AddRange(CreateActivityOverview());
return contents;
}
示例6: DuplicateBookmarksToDestinations
public void DuplicateBookmarksToDestinations(string document)
{
if (string.IsNullOrEmpty(document))
throw new NullReferenceException("Empty filename passed.");
if (!File.Exists(document))
throw new FileNotFoundException(string.Format("{0} does not exist.", document));
var bookmarks = GetBookmarksFromDocument(document);
var nameddests = new List<INamedDestination>();
foreach (var topLevelBookmark in bookmarks)
{
nameddests.AddRange(GetFlattenedDestinations(topLevelBookmark));
}
InsertDestinationsIntoDocument(document, nameddests);
}
示例7: ExtractLocationsFromRedactAnnot
/**
* Extracts locations from the concrete annotation.
* Note: annotation can consist not only of one area specified by the RECT entry, but also of multiple areas specified
* by the QuadPoints entry in the annotation dictionary.
*/
private IList<PdfCleanUpLocation> ExtractLocationsFromRedactAnnot(int page, int annotIndex, PdfDictionary annotDict) {
IList<PdfCleanUpLocation> locations = new List<PdfCleanUpLocation>();
List<Rectangle> markedRectangles = new List<Rectangle>();
PdfArray quadPoints = annotDict.GetAsArray(PdfName.QUADPOINTS);
if (quadPoints.Size != 0) {
markedRectangles.AddRange(TranslateQuadPointsToRectangles(quadPoints));
} else {
PdfArray annotRect = annotDict.GetAsArray(PdfName.RECT);
markedRectangles.Add(new Rectangle(annotRect.GetAsNumber(0).FloatValue,
annotRect.GetAsNumber(1).FloatValue,
annotRect.GetAsNumber(2).FloatValue,
annotRect.GetAsNumber(3).FloatValue));
}
clippingRects.Add(annotIndex, markedRectangles);
BaseColor cleanUpColor = null;
PdfArray ic = annotDict.GetAsArray(PdfName.IC);
if (ic != null) {
cleanUpColor = new BaseColor(
ic.GetAsNumber(0).FloatValue,
ic.GetAsNumber(1).FloatValue,
ic.GetAsNumber(2).FloatValue
);
}
PdfStream ro = annotDict.GetAsStream(PdfName.RO);
if (ro != null) {
cleanUpColor = null;
}
foreach (Rectangle rect in markedRectangles) {
locations.Add(new PdfCleanUpLocation(page, rect, cleanUpColor));
}
return locations;
}
示例8: ExtractLocationsFromRedactAnnots
/**
* Extracts locations from the redact annotations contained in the document and applied to the given page.
*/
private IList<PdfCleanUpLocation> ExtractLocationsFromRedactAnnots(int page, PdfDictionary pageDict) {
List<PdfCleanUpLocation> locations = new List<PdfCleanUpLocation>();
if (pageDict.Contains(PdfName.ANNOTS)) {
PdfArray annotsArray = pageDict.GetAsArray(PdfName.ANNOTS);
for (int i = 0; i < annotsArray.Size; ++i) {
PdfIndirectReference annotIndirRef = annotsArray.GetAsIndirectObject(i);
PdfDictionary annotDict = annotsArray.GetAsDict(i);
PdfName annotSubtype = annotDict.GetAsName(PdfName.SUBTYPE);
if (annotSubtype.Equals(PdfName.REDACT)) {
SaveRedactAnnotIndirRef(page, annotIndirRef.ToString());
locations.AddRange(ExtractLocationsFromRedactAnnot(page, i, annotDict));
}
}
}
return locations;
}
示例9: End
//.........这里部分代码省略.........
for (int column = 0; column < columnWidths.Length; column++) {
if (fixedWidths[column] == 0) {
columnWidths[column] *= targetPercentage;
}
}
}
}
try {
table.SetTotalWidth(columnWidths);
table.LockedWidth = true;
table.DefaultCell.Border = Rectangle.NO_BORDER;
} catch (DocumentException e) {
throw new RuntimeWorkerException(LocaleMessages.GetInstance().GetMessage(LocaleMessages.NO_CUSTOM_CONTEXT), e);
}
float? tableHeight = new HeightCalculator().GetHeight(tag, GetHtmlPipelineContext(ctx).PageSize.Height);
float? tableRowHeight = null;
if (tableHeight != null && tableHeight > 0)
tableRowHeight = tableHeight / tableRows.Count;
int rowNumber = 0;
foreach (TableRowElement row in tableRows) {
int columnNumber = -1;
float? computedRowHeight = null;
/*if ( tableHeight != null && tableRows.IndexOf(row) == tableRows.Count - 1) {
float computedTableHeigt = table.CalculateHeights();
computedRowHeight = tableHeight - computedTableHeigt;
}*/
IList<HtmlCell> rowContent = row.Content;
if(rowContent.Count < 1)
continue;
foreach (HtmlCell cell in rowContent) {
IList<IElement> compositeElements = cell.CompositeElements;
if (compositeElements != null) {
foreach (IElement baseLevel in compositeElements) {
if (baseLevel is PdfPTable) {
TableStyleValues cellValues = cell.CellValues;
float totalBordersWidth = cellValues.IsLastInRow ? styleValues.HorBorderSpacing * 2
: styleValues.HorBorderSpacing;
totalBordersWidth += cellValues.BorderWidthLeft + cellValues.BorderWidthRight;
float columnWidth = 0;
for (int currentColumnNumber = columnNumber + 1; currentColumnNumber <= columnNumber + cell.Colspan; currentColumnNumber++){
columnWidth += columnWidths[currentColumnNumber];
}
IPdfPTableEvent tableEvent = ((PdfPTable) baseLevel).TableEvent;
TableStyleValues innerStyleValues = ((TableBorderEvent) tableEvent).TableStyleValues;
totalBordersWidth += innerStyleValues.BorderWidthLeft;
totalBordersWidth += innerStyleValues.BorderWidthRight;
((PdfPTable) baseLevel).TotalWidth = columnWidth - totalBordersWidth;
}
}
}
columnNumber += cell.Colspan;
table.AddCell(cell);
}
table.CompleteRow();
if ((computedRowHeight == null || computedRowHeight <= 0) && tableRowHeight != null)
computedRowHeight = tableRowHeight;
if (computedRowHeight != null && computedRowHeight > 0) {
float rowHeight = table.GetRow(rowNumber).MaxHeights;
if (rowHeight < computedRowHeight) {
table.GetRow(rowNumber).MaxHeights = computedRowHeight.Value;
}
else if (tableRowHeight != null && tableRowHeight < rowHeight)
{
tableRowHeight = (tableHeight - rowHeight - rowNumber * tableRowHeight)
/ (tableRows.Count - rowNumber - 1);
}
}
rowNumber++;
}
if (percentage) {
table.WidthPercentage = utils.ParsePxInCmMmPcToPt(widthValue);
table.LockedWidth = false;
}
List<IElement> elems = new List<IElement>();
if (invalidRowElements.Count > 0) {
// all invalid row elements taken as caption
int i = 0;
Tag captionTag = tag.Children[i++];
while (!Util.EqualsIgnoreCase(captionTag.Name, HTML.Tag.CAPTION) && i < tag.Children.Count) {
captionTag = tag.Children[i];
i++;
}
String captionSideValue;
captionTag.CSS.TryGetValue(CSS.Property.CAPTION_SIDE, out captionSideValue);
if (captionSideValue != null && Util.EqualsIgnoreCase(captionSideValue, CSS.Value.BOTTOM)) {
elems.Add(table);
elems.AddRange(invalidRowElements);
} else {
elems.AddRange(invalidRowElements);
elems.Add(table);
}
} else {
elems.Add(table);
}
return elems;
} catch (NoCustomContextException e) {
throw new RuntimeWorkerException(LocaleMessages.GetInstance().GetMessage(LocaleMessages.NO_CUSTOM_CONTEXT), e);
}
}
示例10: searchResults
public ActionResult searchResults()
{
TempData.Keep();
searchViewModel advancedSearch = (searchViewModel)TempData["search"];
if (advancedSearch == null)
{
return RedirectToAction("Index");
}
//List<Indicators> indicatorList = db.Indicators.ToList();
List<Indicators> indicatorList = db.Indicators.Where(x => x.Area_ID.Equals(1)).Where(y => y.Indicator_CoE_Map.Any(x => x.CoE_ID.Equals(10) || x.CoE_ID.Equals(27) || x.CoE_ID.Equals(30) || x.CoE_ID.Equals(40) || x.CoE_ID.Equals(50))).ToList();
List<Indicators> indicatorListString = new List<Indicators>();
string searchString = advancedSearch.searchString;
if (searchString != null)
{
string[] searchStrings;
searchStrings = searchString.Split(' ');
foreach (var sS in searchStrings)
{
indicatorList = indicatorList.Where(s => s.Indicator != null && s.Indicator.ToLower().Contains(sS.ToLower())).ToList();
}
}
List<Indicators> indicatorListCoE = new List<Indicators>();
List<selectedCoEs> searchCoEs;
searchCoEs = advancedSearch.selectedCoEs;
if (searchCoEs != null)
{
foreach (var coe in searchCoEs)
{
indicatorListCoE.AddRange(db.Indicators.Where(s => s.Indicator_CoE_Map.Any(x => x.CoE_ID == coe.CoE_ID)).ToList());
}
indicatorList = indicatorList.Intersect(indicatorListCoE).ToList();
}
List<Indicators> indicatorListAreas = new List<Indicators>();
List<selectedAreas> searchAreas;
searchAreas = advancedSearch.selectedAreas;
if (searchAreas != null)
{
foreach (var area in searchAreas)
{
indicatorListAreas.AddRange(db.Indicators.Where(s => s.Area_ID == area.Area_ID).ToList());
}
indicatorList = indicatorList.Intersect(indicatorListAreas).ToList();
}
List<Indicators> indicatorListTypes = new List<Indicators>();
List<selectedTypes> searchTypes;
searchTypes = advancedSearch.selectedTypes;
if (searchTypes != null)
{
foreach (var type in searchTypes)
{
indicatorListTypes.AddRange(db.Indicators.Where(s => s.Indicator_Type.Replace("/", "").Replace("&", "").Replace(" ", "") == type.Indicator_Type).ToList());
}
indicatorList = indicatorList.Intersect(indicatorListTypes).ToList();
}
List<Indicators> indicatorListFootnotes = new List<Indicators>();
List<selectedFootnotes> searchFootnotes;
searchFootnotes = advancedSearch.selectedFootnotes;
if (searchFootnotes != null)
{
foreach (var footnote in searchFootnotes)
{
indicatorListFootnotes.AddRange(db.Indicators.Where(s => s.Indicator_Footnote_Map.Any(x => x.Footnote_ID == footnote.Footnote_ID)).ToList());
}
indicatorList = indicatorList.Intersect(indicatorListFootnotes).ToList();
}
if (ModelState.IsValid)
{
var viewModel = new indexViewModel
{
allIndicators = indicatorList.Distinct().ToList(),
// allCoEs = db.CoEs.ToList(),
// allAreas = db.Areas.ToList(),
// allFootnotes = db.Footnotes.ToList()
};
return View(viewModel);
}
return View();
}
示例11: Index
public ActionResult Index()
{
var user = userRepository.GetUserByUsername(User.Identity.Name);
var allPolls = new List<Poll>();
allPolls.AddRange(user.ManagedPolls);
allPolls.AddRange(user.CreatedPolls);
allPolls.AddRange(pollRepository.GetPollsMasteredBy(user));
return View(allPolls.Distinct().OrderByDescending(p => p.pollID).ToList());
}
示例12: printHorizontalStackPanel
private void printHorizontalStackPanel()
{
if (SharedData.PageSetup.MainTablePreferences.TableType != TableType.HorizontalStackPanel)
return;
var hasTableRowNumberColumn = SharedData.HasTableRowNumberColumn;
var columnsNumber = SharedData.HorizontalStackPanelColumnsPerRow;
if (hasTableRowNumberColumn)
columnsNumber--;
var itemsToTake = columnsNumber;
var customRow = new List<CellData>();
foreach (var row in SharedData.MainTableDataSource.Rows())
{
if (row == null) continue;
var rowObjectColumnsCount = row.Count;
var tempRow = row.Take(itemsToTake).ToList();
var diff = (columnsNumber * rowObjectColumnsCount) - customRow.Count - tempRow.Count;
bool rowIsReady;
if (diff == 0)
{
rowIsReady = true;
itemsToTake = columnsNumber;
}
else
{
itemsToTake = diff;
rowIsReady = false;
}
customRow.AddRange(tempRow);
if (!rowIsReady) continue;
var index = hasTableRowNumberColumn ? 1 : 0;
for (int i = 0; i < customRow.Count; i++)
{
if ((i > 0) && (i % rowObjectColumnsCount == 0))
index++; // All columns of an object will create a single cell here.
customRow[i].PropertyIndex = index;
}
fireRowStartedInjectCustomRowsEvent(customRow);
addSingleRow(customRow);
fireRowAddedInjectCustomRowsEvent(customRow);
customRow.Clear();
}
}
示例13: SignatoriesAcc
private List<SIGNATORIES> SignatoriesAcc(string accountNumber, DateTime reportDate)
{
var model = new List<SIGNATORIES>();
model.AddRange(_repository.Fetch<SIGNATORIES>()
.Where(p => p.ACCOUNTS == accountNumber && p.Reportdate == reportDate));
return model;
}
示例14: WritePdf
//.........这里部分代码省略.........
ptable.AddCell(cell);
cell = new PdfPCell(new Phrase("料位", font));
cell.DisableBorderSide(1);
cell.DisableBorderSide(2);
ptable.AddCell(cell);
cell = new PdfPCell(new Phrase("規格", font));
cell.DisableBorderSide(1);
cell.DisableBorderSide(2);
ptable.AddCell(cell);
cell = new PdfPCell(new Phrase("不允收數量", font));
cell.DisableBorderSide(1);
ptable.AddCell(cell);
cell = new PdfPCell(new Phrase("有效期天數", font));
cell.DisableBorderSide(1);
ptable.AddCell(cell);
cell = new PdfPCell(new Phrase("", font));
cell.DisableBorderSide(1);
ptable.AddCell(cell);
cell = new PdfPCell(new Phrase("", font));
cell.DisableBorderSide(1);
ptable.AddCell(cell);
#endregion
_ipodMgr = new IpodMgr(mySqlConnectionString);
ipod = new IpodQuery();
ipod.po_id = ipoStore[a].po_id;
ipod.IsPage = false;
ipodStore = new List<IpodQuery>();
ipodStore = _ipodMgr.GetIpodList(ipod, out totalCount);
List<IpodQuery> Ipodleibie = new List<IpodQuery>();
Ipodleibie.AddRange(product_freight_set_mapping[key]);
#region 循環讀取數據填入表格
DataTable Ipod_dt = new DataTable();
Ipod_dt.Columns.Add("序號", typeof(string));
Ipod_dt.Columns.Add("國際條碼", typeof(string));
Ipod_dt.Columns.Add("品號", typeof(string));
Ipod_dt.Columns.Add("採購數量", typeof(string));
Ipod_dt.Columns.Add("允收天數", typeof(string));
Ipod_dt.Columns.Add("製造日期", typeof(string));
Ipod_dt.Columns.Add("備註", typeof(string));
Ipod_dt.Columns.Add("Empty_1", typeof(string));
Ipod_dt.Columns.Add("供應商店內碼", typeof(string));
Ipod_dt.Columns.Add("品名", typeof(string));
Ipod_dt.Columns.Add("允收數量", typeof(string));
Ipod_dt.Columns.Add("允出天數", typeof(string));
Ipod_dt.Columns.Add("有效日期", typeof(string));
Ipod_dt.Columns.Add("Empty_3", typeof(string));
Ipod_dt.Columns.Add("Empty_4", typeof(string));
Ipod_dt.Columns.Add("料位", typeof(string));
Ipod_dt.Columns.Add("規格", typeof(string));
Ipod_dt.Columns.Add("不允收數量", typeof(string));
Ipod_dt.Columns.Add("有效期天數", typeof(string));
Ipod_dt.Columns.Add("Empty_5", typeof(string));
Ipod_dt.Columns.Add("Empty_6", typeof(string));
for (int i = 0; i < Ipodleibie.Count; i++)
{
DataRow newRow = Ipod_dt.NewRow();
newRow["國際條碼"] = Ipodleibie[i].upc_id_international;
newRow["品號"] = Ipodleibie[i].Erp_Id.ToString();
newRow["採購數量"] = Ipodleibie[i].qty_ord.ToString();
newRow["允收天數"] = Ipodleibie[i].cde_dt_var.ToString();
示例15: SubPoenaDetailList
//.........这里部分代码省略.........
// }
// }
// }
#endregion
//(合併數據來自www/Model/Deliver.Php,第1391~1463行)
#region 測試方法
List<Parametersrc> Shipment = new List<Parametersrc>();
_ptersrc = new ParameterMgr(mySqlConnectionString);
Shipment = _ptersrc.GetAllKindType("order_status");//訂單狀態
Dictionary<string, string> _dtOrderStatus = new Dictionary<string, string>();
foreach (var item in Shipment)
{
_dtOrderStatus.Add(item.ParameterCode, item.remark);
}
Dictionary<int, string> freight_set_map = new Dictionary<int, string>();
freight_set_map.Add(1, "常溫");
freight_set_map.Add(2, "冷凍");
freight_set_map.Add(5, "冷藏");
Dictionary<int, string> product_freight_set_mapping = new Dictionary<int, string>();
product_freight_set_mapping.Add(1, "1");
product_freight_set_mapping.Add(2, "2");
product_freight_set_mapping.Add(3, "1");
product_freight_set_mapping.Add(4, "2");
product_freight_set_mapping.Add(5, "5");
product_freight_set_mapping.Add(6, "5");
Dictionary<string, List<OrderDetailQuery>> one_product = new Dictionary<string, List<OrderDetailQuery>>(); //單一商品
Dictionary<string, List<OrderDetailQuery>> combination = new Dictionary<string, List<OrderDetailQuery>>(); //組合商品
List<OrderDetailQuery> combination_head = new List<OrderDetailQuery>(); //組合品名
List<OrderDetailQuery> combination_tail = new List<OrderDetailQuery>(); //子商品名
List<OrderDetailQuery> new_order_detail = new List<OrderDetailQuery>(); ; //新商品資料
List<OrderDetailQuery> since_order = new List<OrderDetailQuery>(); //自出商品
since_order.AddRange(new_order_detail);
int w = since_order.Count;
string frest;
#region 把所有的商品,把單一和組合拆分開
//把所有的商品,把單一和組合區分開,然後把組合的商品運送方式區分開(常溫冷凍冷藏)
foreach (var item in store)
{
if (item.Combined_Mode > 1)
{
if (item.item_mode == 1)
combination_head.Add(item);
else
combination_tail.Add(item);
}
else
{
frest = "";
frest = product_freight_set_mapping[int.Parse(item.Product_Freight_Set.ToString())];
if (!one_product.Keys.Contains(frest))
{
List<OrderDetailQuery> s = new List<OrderDetailQuery>();
one_product.Add(frest, s);
}
one_product[frest].Add(item);
//one_product.Add(frest, item);
}
}
#endregion
#region 把組合商品中拆分開子商品和父商品
//把組合商品拆分開,并計算子商品的數量,把子商品按照運送方式再次拆開