Delphi Prism 中 TStringList 的替代品。

发布于 2024-08-04 03:12:47 字数 116 浏览 2 评论 0原文

我正在将用 Delphi 2007 .Net 编写的应用程序迁移到 Delphi Prism,哪个是替换 TStringList 和 TStrings 类的最佳选择?

提前致谢。

再见。

I am migrating an application written in Delphi 2007 .Net to Delphi Prism, which is the best option to replace the TStringList and TStrings class?

Thanks in advance.

Bye.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

尛丟丟 2024-08-11 03:12:47

只需使用 .NET 框架中内置的 List 类型,或者 字符串集合

最简单的是通用列表

List<String>

但是 StringCollection 有一些位列表中没有;您可以在

使用内置 .NET Framework 类的优点是 MSDN 上有大量文档,其中有大量示例(例如CodeProject),并且通常支持更多功能(例如实现数据绑定所需的接口等) :ShineOn 中的 TStringList 不会这样做)。

使用类似 VCL 的优点是您对 VCL 更加熟悉,因此可以更快地上手。但 VCL.NET 没有得到进一步发展是有原因的...

Janka Janos 有一个很棒的 C# 和 Delphi Prism 中的功能比较表
这将帮助您将 C# 示例转换为 Delphi Prism 代码。

——杰罗恩

Just use the built in List types in the .NET framework, or the StringCollection.

The easiest are the generic lists:

List<String>

But StringCollection has a few bits that the List does not have; you can read a bit about that in this thread.

The advantage of using built-in .NET Framework classes, is that there is plenty documentation at MSDN, have loads of examples (for instance atCodeProject), and usually support more features (like implementing required interfaces to do data binding and such: the TStringList in ShineOn does not do that).

The advantage of using VCL like things is that you are more familiar with the VCL so it gets you started quicker. But there is a reason why VCL.NET has not been developed further...

Janka Janos has a great comparison chart of features in C# and Delphi Prism.
That will help you translate C# examples into Delphi Prism code.

--jeroen

感情废物 2024-08-11 03:12:47

Have you looked at ShineOn? It has a Classes.pas with TStringList in it.

看海 2024-08-11 03:12:47

我在我完成的一点 C# 中使用了 Collections.Specialized.HybridDictionary (和类似的)类。由于它是一个标准的 .net 对象,因此应该在 Prism 中可用。

我不知道它是否有 LoadFrom/Save to file

I have used Collections.Specialized.HybridDictionary (and similar) classes in the little bit of C# I have done. As it is a standard .net object it should be available in Prism.

I don't know if it has a LoadFrom/Save to file though

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文