why dont you follow msdn as its the first place i look for best practices. This is for spweb in an event reciver ;) also your doesItHaveIt(SPItemEventProperties properties)
already handels a web object in properties
so there is no need to dispose of the object.
http://msdn.microsoft.com/en-us/library/ee724407(v=office.14).aspx
good
// Retrieve SPWeb and SPListItem from SPItemEventProperties instead of
// from a new instance of SPSite.
SPWeb web = properties.OpenWeb();
// Operate on the SPWeb object.
SPListItem item = properties.ListItem;
// Operate on an item.
bad
public override void ItemDeleting(SPItemEventProperties properties)
{
using (SPSite site = new SPSite(properties.WebUrl))
{
using (SPWeb web = site.OpenWeb())
{
SPList list = web.Lists[properties.ListId];
SPListItem item = list.GetItemByUniqueId(properties.ListItemId);
// Operate on an item.
}
}
}
for your resource string:
SPUtility.GetLocalizedString("$Resources: GetAllitems", "core", 1033);
it translates as, get GetAllitems from core.resx with the language of en-US (english)
which makes the file core.en-US.resx within web server extensions\12\Resources
as alexander pointed out from msdn:
sourceType:
System.String An ASP.NET resource expression in the form
$Resources:keyname, where keyname is the name half of a name/value
pair in a resource file (.resx).
defaultResourceFileType:
System.String The base file name of the language resource file
containing a localized string value. For example, if you have a series
of resource files named myresources.en-us.resx,
myresources.es-es.resx, myresources.de-de.resx, and so on, the value
to pass in this parameter is myresources.
languageType:
System.UInt32
The LCID of the target language. For a list, see the overview topic
for the CultureInfo class.
hope it helps :)