SPFieldWorkflowStatus.FieldValueType 属性

获取字段值的类型。

命名空间:  Microsoft.SharePoint
程序集:  Microsoft.SharePoint(位于 Microsoft.SharePoint.dll 中)

语法

声明
Public Overrides ReadOnly Property FieldValueType As Type
    Get
用法
Dim instance As SPFieldWorkflowStatus
Dim value As Type

value = instance.FieldValueType
public override Type FieldValueType { get; }

属性值

类型:System.Type
一个代表类型Int32的对象。

备注

可以使用FieldValueType属性获取已强制转换为类型SPFieldWorkflowStatus的字段值的类型。在这种情况下,则FieldValueType属性返回Int32

示例

下面的示例是值的一个控制台应用程序打印FieldValueType属性的字符串表示形式。

应用程序假定网站具有一个名为"Test List"列表和列表具有至少一个工作流关联。

Imports System
Imports Microsoft.SharePoint
Imports Microsoft.SharePoint.Workflow

Module ConsoleApp
   Sub Main()
      Using site As SPSite = New SPSite("https://localhost")
         Using web As SPWeb = site.OpenWeb()

            Dim listName As String = "Test List"

            Dim list As SPList = web.Lists(listName)
            Dim association As SPWorkflowAssociation = list.WorkflowAssociations(0)

            Dim statusField As SPFieldWorkflowStatus = _
                CType(list.Fields.GetField(association.Name), SPFieldWorkflowStatus)

            Console.WriteLine(statusField.FieldValueType.ToString())

         End Using
      End Using
      Console.Write(vbCrLf + "Press ENTER to continue...")
      Console.ReadLine()
   End Sub
End Module
using System;
using Microsoft.SharePoint;
using Microsoft.SharePoint.Workflow;

namespace Test
{
   class ConsoleApp
   {
      static void Main(string[] args)
      {
         using (SPSite site = new SPSite("https://localhost"))
         {
            using (SPWeb web = site.OpenWeb())
            {
               string listName = "Test List";

               SPList list = web.Lists[listName];
               SPWorkflowAssociation association = list.WorkflowAssociations[0];

               SPFieldWorkflowStatus statusField = 
                  list.Fields.GetField(association.Name) as SPFieldWorkflowStatus;

               Console.WriteLine(statusField.FieldValueType.ToString());
            }
         }
         Console.Write("\nPress ENTER to continue...");
         Console.ReadLine();
      }
   }
}

另请参阅

引用

SPFieldWorkflowStatus 类

SPFieldWorkflowStatus 成员

Microsoft.SharePoint 命名空间