In SharePoint 2010 (Foundation - Server) è stata introdotta una nuova proprietà sull'oggetto SPListItem chiamata IconOverlay.
La proprietà permette di sovrapporre una immagine all'icona dell'item che rappresenta il tipo di file. L'immagine qua sotto chiarisce il concetto:
Icon Overlay
Icon Overlay
dove il file con nome desktop ha l'IconOverlay impostato sull'immagine ACG16.gif (la faccina) presente nella directory images di SharePoint.

Qui sotto un esempio C# che imposta l'icona di overlay su tutti gli item di una lista:

C#

using System;
using Microsoft.SharePoint;

namespace ConsoleSharePoint
{
  class Program
  {
    static void Main(string[] args)
    {
      string url = "http://sp2010/Shared Documents";
      using (SPSite site = new SPSite(url))
      {
        using (SPWeb web = site.OpenWeb())
        {
          SPList list = web.GetList(url);
          foreach (SPListItem item in list.Items)
          {
            item.IconOverlay = "ACG16.gif";
            item.SystemUpdate(false);
          }
        }
      }
    }
  }
}
Tags:
SharePoint497 SharePoint 2010224
Potrebbe interessarti anche: