[转]Dynamics AX and Generic collections of .Net
转自:http://blogs.msdn.com/b/emeadaxsupport/archive/2009/04/23/dynamics-ax-and-generic-collections-of-net.aspx
I'm using Dynamics AX 2009 and want to instantiate the .NET class "System.Collections.Generic.List" in X++.
Intellisense expands the class to "System.Collections.Generic.List`1" however the code cannot be compiled as the class as well as all other classes in the "System.Collections.Generic" namespace are not accepted.
Actually this type as well as every type defined in the namespace System.Collections.Generic are no regular types (are classes) but they are so called "Generics". You can see this for example when you are using a Generic in C#, where you have to specify the type of the Generic at declaration / definition (here the for example for string):
More information about .NET Generics can be found here:
Generics (C# Programming Guide)
For Dynamics AX 4.0 Generics are not supported by the X++ language. This is outlined in the Microsoft Press book "Inside Dynamics AX" on page 111: The following feature of CLR cannot be used with X++:
- Public fields (These can be accessed by using CLR reflection classes.)
- Events and delegates
- The ref parameter modifier
- The out parameter modifier
- Generics
- Inner classes
- The Container composite type
- The Array composite type
- Namespace declarations
Besides the "swapping" of the Generic collection into an own Assembly that is referenced back in to Dynamics AX, the only recommendation is to use the Non-Generic counterpart of the collection (see table below).
| Generic | Non-Generic | |
|---|---|---|
| System.Collections.Generic | System.Collections | |
| Collection<T> | CollectionBase | |
| Comparer<T> | Comparer | |
| Dictionary<K, V> | Hashtable | |
| List<T> | ArrayList | |
| Queue<T> | Queue | |
| SortedDictionary<K, V> | SortedList | |
| Stack<T> | Stack | |
| ReadOnlyCollection<T> | ReadOnlyCollectionBase |
So in our case the Non-Generic counterpart of "System.Collection.Generic.List<T>" would be "System.Collections.ArrayList".
| --author: | Alexander Lachner |
| --editor: | Alexander Lachner |
| --date: | 23/04/2009 |
[转]Dynamics AX and Generic collections of .Net的更多相关文章
- Session for SSRS Report of Microsoft Dynamics AX
Session for SSRS Report of Microsoft Dynamics AX 版权声明:本文为博主原创文章,未经博主允许不得转载. Contract •A data contrac ...
- Microsoft Dynamics AX 7 新特性探索 - Demo 部署(Part 1)
Dynamics AX 7已经发布了一段时间了,我们知道这次微软为我们带来了许多令人激动的新特性.在这个系列里,Reinhard将揭开New Dynamics AX的神秘面纱,和大家一起探索这些新的特 ...
- Dynamics AX 2012 的工业物联网解决方案
Dynamics AX 2012 的工业物联网解决方案 物联网 物联网的概念在这两年非常火,包括近期很火的共享单车初创公司--摩拜单车,在产品中运用了Azure Iot物联网技术.但是,物联网并不是一 ...
- Dynamics AX 2012 在BI分析中建立数据仓库的必要性
AX系统已有的BI分析架构 对于AX 的BI分析架构,相信大家都了解,可以看Reinhard之前的译文[译]Dynamics AX 2012 R2 BI系列-分析的架构 . AX 的BI分析架构的优势 ...
- Dynamics AX 2012 R2 业务系列-销售业务流程
在博文Dynamics AX R2 业务系列中,Reinhard对这个系列做了一个规划,下面我们就按照规划开始说业务吧. 1.销售的主要职责 其实这里说的职责主要是针对销售文员,并非整天外面满世界跑业 ...
- Dynamics AX 2012 R2 安装Reporting Services 扩展
今天Reinhard在VS中部署SSRS报表时,接到以下错误: 部署因错误而被取消.在报表服务器上,验证:-SQL Server Reporting Services 服务是否正在运行. 接着,Rei ...
- Dynamics AX 2012 R2 业务系列-采购业务流程
在博文Dynamics AX R2 业务系列中,Reinhard对这个系列做了一个规划,下面我们就按照规划开始说业务吧. 国际惯例,从采购开始. 1.采购的主要职责 简单点说,采购的主要职责,是从供应 ...
- Dynamics AX 2012 R2 业务系列
在之前的一系列博文里,Reinhard介绍了Dynamics AX Demo的安装与配置.相信同学们看完后,都已经成功拥有了一个测试环境. 众所周知的是,ERP作为一个特殊的软件系统,他有着背后的业务 ...
- Dynamics AX 2012 R2 如何处理运行时间较长的报表
当处理的数据量较多,逻辑比较复杂时,报表可能会超时.为了解决这个问题,Reinhard一直使用SrsReportDataProviderPreProcess来做预处理报表.它会在调用SSRS前,在AX ...
随机推荐
- 新增WiFi真机同步与实时预览功能 简化真机调试步骤
APICloud工具插件为开发者提供iOS和Android平台真机同步调试功能,不仅可以通过USB方式进行APP真机同步功能,更新增WiFi真机同步和WiFi真机实时预览两大功能,方便开发者在开发过程 ...
- JBoss远程方法调用漏洞利用详解
早上起床打开微博看到空虚浪子心大神发的一篇有关Jboss漏洞的文章,对我等菜鸟来说那边文章看起来还是很吃力的,所以查了查国内外的资料,翻译写了这边文章,记录一下. 在JBoss服务器上部署web应用程 ...
- [BS-02] iOS数组、字典、NSNumber 新写法—— @[]、@{}
IOS数组.字典.NSNumber 新写法—— @[].@{} //标准写法 NSNumber * number = [NSNumber numberWithInt:]; NSArray * ar ...
- 奥威Power-BI V11——凤凰涅槃,重磅来袭
时隔一年,奥威Power-BI重磅再推新版,在之前V10 WEB可视化前端分析工具基础上,更加注重用户体验这一块.V11站在用户的角度,以用户的视野去设计研发新版本,最终在前端框架的优化.移动设备的体 ...
- shellinabox安装
Shell In A Box(发音是shellinabox)是一款基于Web的终端模仿器,由Markus Gutschke开辟而成.它有内置的Web办事器,在指定的端口上作为一个基于Web的SSH客户 ...
- 安装和删除 Alcatraz 插件
在终端下输入如下命令来安装Alcatraz: curl -fsSL https://raw.github.com/supermarin/Alcatraz/master/Scripts/install. ...
- debug 使用lldb
http://www.zddhub.com/memo/2015/12/20/lldb-golang-debug/ go build -gcflags "-N -l" -o test ...
- 使用duplicate target database ... from active database复制数据库
使用duplicate target database ... from active database复制数据库 source db:ora11auxiliary db:dupdb 1.修改监听文件 ...
- 学习OpenCV——Kalman滤波
背景: 卡尔曼滤波是一种高效率的递归滤波器(自回归滤波器), 它能够从一系列的不完全及包含噪声的测量中,估计动态系统的状态.卡尔曼滤波的一个典型实例是从一组有限的,包含噪声的,对物体位置的观察序列(可 ...
- Leetcode: Lexicographical Numbers
Given an integer n, return 1 - n in lexicographical order. For example, given 13, return: [1,10,11,1 ...