Показать сообщение отдельно
Старый 08.12.2015, 16:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,477 / 846 (79) +++++++
Регистрация: 28.10.2006
mfp: X++ in AX7: Private and public members
Источник: http://blogs.msdn.com/b/mfp/archive/...c-members.aspx
==============
Since the first version of Axapta, member variables in classes have been protected. In AX7 the default remains protected, however, you can now mark them as public or private.

Here is an example:

class MyClass
{
public int PublicMember;
private int privateMember;
int protectedMember; //Defaults to protected
protected int explicitlyProtectedMember;
}



You can access the public member using the same syntax as when accessing fields on Tables (or properties in C#). Notice the best practice is to use PascalCasing for public members – just like for fields on tables.

var myClass = new MyClass();
myClass.PublicMember = 42;


There is still no support for getters and setters (like we know them from C#).






THIS POST APPLIES TO MICROSOFT DYNAMICS AX7 PREVIEW; IS PROVIDED AS-IS AND CONFERS NO RIGHTS.






==============
Источник: http://blogs.msdn.com/b/mfp/archive/...c-members.aspx
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.