You have a document library named MyDocs. MyDocs has a column named Column1. Column1
is a required column. You discover that many documents are checked out because users fail to
enter a value for Column1. You need to create a Web Part to delete the documents. Which code
segment should you include in the Web Part?
A.
foreach (SPCheckedOutFile file in ((SPDocumentLibrary)SPContext.Current.Web.
Lists[“MyDocs”]).CheckedOutFiles) { file.Delete(); }
B.
foreach (SPCheckedOutFile file in ((SPDocumentLibrary)SPContext.Current.Web.
Lists[“MyDocs”]).CheckedOutFiles) { file.TakeOverCheckOut(); }
C.
foreach (SPListItem file in ((SPDocumentLibrary)SPContext.Current.Web.Lists
[“MyDocs”]).Items) { if ((file(“CheckOutStatus”) == “CheckOut”)) { file.Delete(); } }
D.
foreach (SPItem file in SPContext.Current.Web.Lists[“MyDocs”].Items) { if
((file(“CheckOutStatus”) == “CheckOut”)) { file.Delete(); } }