小编Bor*_*ski的帖子

如何使用LINQ和C#找到最接近0,0点的点

我有一个点列表(列表)

  • 7,43
  • 7,42
  • 6,42
  • 5,42
  • 6,43
  • 5,43

我想使用linq表达式来获得最接近0,0的点.例如 - 对于此列表,我预计值为5,42.

如何用LINQ找到最接近0,0点的点?

c# linq point

9
推荐指数
1
解决办法
3094
查看次数

实现MVVMC和依赖注入

刚才我看到这个文章关于MVVMC模式.现在我有一个问题.是应该将Controller注入ViewModel,还是将ViewModel注入Controller?

dependency-injection mvvm

7
推荐指数
3
解决办法
6169
查看次数

使用OpenXML将Word docx转换为Excel

有没有办法将Word文档转换为Excel文件?转换表格会非常有帮助.

像这样的东西:

  • 使用OpenXML打开Word文档
  • 找到所有表格xml-tags
  • 复制xml标签
  • 创建Excel文件
  • 将带有Word的表格的xml-tags插入到新的Excel文件中

我的意思是

void OpenWordDoc(string filePath)
{
_documentWord = SpreadsheetDocument.Open(filePath, true);
}

List<string> GetAllTablesXMLTags()
{
//find and copy
}

List<string> CreateExcelFile(string filePath)
{
TemplateExcelDocument excelDocument = new TemplateExcelDocument();
_documentExcel = excelDocument.CreatePackage(filePath);
}

void InsertXmlTagsToExcelFile(string filePath)
{
CreateExcelFiles(filePath);
var xmlTable = GetAllTablesXMLTags();
// ... insert to _documentExcel
}
Run Code Online (Sandbox Code Playgroud)

c# excel ms-word openxml

6
推荐指数
1
解决办法
3450
查看次数

标签 统计

c# ×2

dependency-injection ×1

excel ×1

linq ×1

ms-word ×1

mvvm ×1

openxml ×1

point ×1