在SDK中,有如下的一张表格。我们的写法完全是依托在此基础之上。
Name | Format |
Attachments | System.Boolean |
Boolean | System.Boolean |
Calculated | N/A |
Choice | System.String |
Computed | N/A |
Counter | System.Int32 |
CrossProjectLink | System.Boolean |
Currency | System.Double |
DateTime | System.DateTime |
GridChoice | System.String |
Guid | System.Guid |
Integer | System.Int32 |
Lookup | System.String |
MaxItems | System.Int32 |
ModStat | System.Int32 |
MultiChoice | System.String |
Note | System.String |
Number | System.Double |
Recurrence | System.Boolean |
Text | System.String |
Threading | System.String |
URL | System.String, System.String |
User | System.String |
比如,我们现在要Add或Update一个URL类型的字段。可以这样书写Field:
<
Field
Name
="SomeUrl"
>
http://www.example.com, Example
</
Field
>
该例中某列表项的SomeUrl字段是链接类型的,我们要写一个链接到这个字段。该链接的地址为“http://www.example.com”,标题为“Example” 。
注意:对于链接类型的字段,由于标题可以不填。(这样系统会默认以地址的内容作标题,这一点和许多文本编辑器相同。)所以上面的例子也可以这样写:
<
Field
Name
="SomeUrl"
>
http://www.example.com,
</
Field
>
再如,我们现在要Add或Update一个选项类型的字段。可以这样书写Field:
<
Field
Name
="Status"
>已完成
</
Field
>
任务列表中的状态字段就是选项类型的,由于其对应的是System.String,所以可以直接这么写。