SPUsageDefinition.GetLocal<T> 方法

This static method is used instead of the constructor to create a new instance of the derived SPUsageDefinition class, if necessary, and to retrieve it from the database.

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

语法

声明
Public Shared Function GetLocal(Of T As {New, SPUsageDefinition}) As T
用法
Dim returnValue As T

returnValue = SPUsageDefinition.GetLocal()
public static T GetLocal<T>()
where T : new(), SPUsageDefinition

类型参数

  • T
    The name of the object that was derived from the SPUsageDefinition class to be retrieved.

返回值

类型:T
If an existing instance of the derived object can be found in the database, this method returns it. Otherwise, if an instance of the derived object cannot be found in the database, this method creates and returns a new instance.

备注

Classes that are derived from this one should include a read-only property called Local to get the local instance of the derived usage definition object. For example:

public static SPUsageDefinitionDerived1 Local 
     { 
       get 
       { 
          return GetLocal<SPUsageDefinitionDerived1>(); 
       } 
     }

另请参阅

引用

SPUsageDefinition 类

SPUsageDefinition 成员

Microsoft.SharePoint.Administration 命名空间