在Delphi Prism中替换TStringList。 [英] Replacement for TStringList in Delphi Prism.

查看:93
本文介绍了在Delphi Prism中替换TStringList。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将用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?

谢谢。

再见。

推荐答案

只需使用.NET框架中的内置列表类型,或使用 StringCollection

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

The最简单的是通用列表

List<String>

但是StringCollection有一些List所没有的;您可以在此线程

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

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

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).

像这样使用VCL的优点是您对VCL更加熟悉,因此可以更快地入门。但是有一个原因为什么VCL.NET没有得到进一步的开发...

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具有出色的 C#和Delphi Prism功能的比较表
这将帮助您将C#示例转换为Delphi Prism代码。

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

这篇关于在Delphi Prism中替换TStringList。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆