How about using ContentIterator ?
http://community.zevenseas.com/Blogs/Robin/Lists/Posts/Post.aspx?ID=122
- .
" " , "FeatureId" :
SPList styleLibrary = rootWeb.Lists.TryGetList("Style Library");
SPFolder folder = styleLibrary.RootFolder;
ContentIterator ci = new ContentIterator();
ci.ProcessFilesInFolder(
styleLibrary,
folder,
true,
new ContentIterator.FileProcessor((SPFile f) =>
{
if (f.Properties.ContainsKey("FeatureId"))
{
if (String.Equals(f.Properties["FeatureId"] as string, featureId, StringComparison.InvariantCultureIgnoreCase))
{
if (f.Level == SPFileLevel.Checkout)
f.CheckIn(String.Empty, SPCheckinType.MajorCheckIn);
if (f.Level == SPFileLevel.Draft)
f.Publish("");
}
}
}),
new ContentIterator.FileProcessorErrorCallout((SPFile f, Exception Ex) =>
{
return false;
}));