小编RRR*_*RRR的帖子

如何使用OpenXml Wordprocessing为每个新页面在表格中创建标题

我正在尝试创建一个带有标题的表.我想要为表所采用的每个新页面重复此标题.如何在C#和OpenXml Wordprocessing中执行此操作?

DocumentFormat.OpenXml.Packaging.WordprocessingDocument internalDoc = 
DocumentFormat.OpenXml.Packaging.WordprocessingDocument.Open(stream, true);

var tables = wordDoc.MainDocumentPart.Document.Descendants<SdtBlock>().Where
( r => r.SdtProperties.GetFirstChild<Tag>().Val.Value.StartsWith(DATA_TABLE_TAG));

Table table = tables.Descendants<Table>().Single();
//Here can I set some property to repeat the header of the table? 
Run Code Online (Sandbox Code Playgroud)

c# ms-word openxml word-2010

5
推荐指数
3
解决办法
5942
查看次数

使用WinDbg分析.NET转储

我正在使用windbg对转储执行分析.以下是我运行的命令

  1. .loadby sos mscorwks - 加载sos dll
  2. ~* e !clrstack - 查看所有线程
  3. ~18s - 将上下文更改为我想要分析的线程
  4. !clrstack - 查看这个线程的调用堆栈.

现在,我想转到堆栈中的每个帧并查看那里的对象/变量的值.我该怎么办?

有没有办法找出线程实际卡住的方法中的行号?

.net windbg dump crash-dumps sos

4
推荐指数
1
解决办法
1万
查看次数

将连续日期组合到范围中

我有一个对象列表

public class sample
{
 public DateTime Date;
 public string content;
}
Run Code Online (Sandbox Code Playgroud)

我希望能够创建一个新对象列表

public class sampleWithIntervals
{
 public DateTime startDate;
 public DateTime endDate;
 public string content;
}
Run Code Online (Sandbox Code Playgroud)

应根据内容将样本对象分组为间隔.间隔可以仅包括原始样本列表中包含的那些日期.我不知道如何在Linq做到这一点.

样本数据:

{"10/1/2013", "x"}
{"10/2/2013", "x"}
{"10/2/2013", "y"}
{"10/3/2013", "x"}
{"10/3/2013", "y"}
{"10/10/2013", "x"}
{"10/11/2013", "x"}
{"10/15/2013", "y"}
{"10/16/2013", "y"}
{"10/20/2013", "y"}

This should give me 
{"10/1/2013","10/3/2013", "x"}
{"10/2/2013","10/3/2013", "y"}
{"10/10/2013","10/11/2013", "x"}
{"10/15/2013","10/16/2013", "y"}
{"10/20/2013","10/20/2013", "y"}
Run Code Online (Sandbox Code Playgroud)

c# linq c#-4.0

3
推荐指数
1
解决办法
2102
查看次数

限制Items控件中显示的行数

有没有办法限制在项目控件中显示的行数。?

我有一个绑定到 Items 控件的可观察字符串集合。我想将要显示的行数限制为一。集合可以有多个。

谢谢,

wpf binding itemscontrol wpf-controls

2
推荐指数
1
解决办法
5153
查看次数

标签 统计

c# ×2

.net ×1

binding ×1

c#-4.0 ×1

crash-dumps ×1

dump ×1

itemscontrol ×1

linq ×1

ms-word ×1

openxml ×1

sos ×1

windbg ×1

word-2010 ×1

wpf ×1

wpf-controls ×1