共用方式為


SPFieldWorkflowStatus.FieldValueType property

取得欄位值的類型。

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'宣告
Public Overrides ReadOnly Property FieldValueType As Type
    Get
'用途
Dim instance As SPFieldWorkflowStatus
Dim value As Type

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

Property value

Type: System.Type
表示Int32類型的物件。

備註

您可以使用FieldValueType屬性來取得已轉換為類型SPFieldWorkflowStatus欄位值的類型。在此例中FieldValueType屬性會傳回Int32

Examples

下列範例會列印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 class

SPFieldWorkflowStatus members

Microsoft.SharePoint namespace