SPFolder.Properties property
Obtém uma tabela de hash que contém metadados para a pasta.
Namespace: Microsoft.SharePoint
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
Syntax
'Declaração
Public ReadOnly Property Properties As Hashtable
Get
'Uso
Dim instance As SPFolder
Dim value As Hashtable
value = instance.Properties
public Hashtable Properties { get; }
Property value
Type: System.Collections.Hashtable
Um objeto System.Collections.Hashtable que contém os metadados.
Comentários
Dica
Armazenar grandes quantidades de dados nessa propriedade seriamente diminuirá o desempenho. Não armazene mais de 1 quilobyte (1k) dos dados do usuário nesta propriedade.
Examples
O exemplo de código a seguir itera através da coleção de pastas do site atual e exibe as propriedades e os valores para cada pasta.
Este exemplo requer diretivas de using (Imports no Visual Basic) para os namespaces Microsoft.SharePoint e Microsoft.SharePoint.Utilities .
SPWeb oWebsite = SPContext.Current.Web;
SPFolderCollection collFolders = oWebsite.Folders;
foreach (SPFolder oFolder in collFolders)
{
System.Collections.Hashtable oHashtable = oFolder.Properties;
System.Collections.ICollection collKeys = oHashtable.Keys;
foreach (object oKey in collKeys)
{
Response.Write(SPEncode.HtmlEncode(oKey.ToString()) + " :: " +
SPEncode.HtmlEncode(hashtable[oKey.ToString()]) + "<BR>");
}
}
Dim oWebsite As SPWeb = SPContext.Current.Web
Dim collFolders As SPFolderCollection = oWebsite.Folders
For Each oFolder As SPFolder In collFolders
Dim oHashtable As System.Collections.Hashtable = oFolder.Properties
Dim collKeys As System.Collections.ICollection = oHashtable.Keys
For Each oKey As Object In collKeys
Response.Write(SPEncode.HtmlEncode(oKey.ToString()) & " :: " & SPEncode.HtmlEncode(hashtable(oKey.ToString())) & "<BR>")
Next oKey
Next oFolder
O exemplo anterior exibe metadados, como o seguinte:
vti_dirlateststamp :: 8/30/2006 1:06:19 AM
vti_etag :: "{101141FF-9E99-4404-AE4D-561B981472E4},0"
vti_isexecutable :: false
vti_candeleteversion :: true
vti_docstoretype :: 1
vti_timecreated :: 8/21/2006 1:28:31 AM
vti_isbrowsable :: true
vti_hassubdirs :: true
vti_listname :: {B6C3C6F9-A256-4FA4-B6A2-97549D48E530}
vti_replid :: rid:{101141FF-9E99-4404-AE4D-561B981472E4}
vti_listenableversioning :: false
vti_listenableminorversions :: false
vti_listbasetype :: 1
vti_level :: 1
vti_rtag :: rt:101141FF-9E99-4404-AE4D-561B981472E4@00000000000
vti_timelastmodified :: 8/21/2006 1:28:41 AM
vti_listservertemplate :: 101
vti_listrequirecheckout :: false
vti_listenablemoderation :: false
vti_listtitle :: TestDocLib2
vti_isscriptable :: false