Is there a way to check if a file is checked out by another user? I am going trhough a list file by file and would like to avoid the "file is opened by another user" error. Something like this would be nice:
Guid id = new Guid(slideLibrary); // ID of Slide-Library.
List list = ctx.Web.Lists.GetById(id);
ListItemCollection items = list.GetItems(CamlQuery.CreateAllItemsQuery());
ctx.Load(items); // Loading all the fields
System.Security.SecureString pwd = new System.Security.SecureString();
foreach (char c in "pwd".ToCharArray()) pwd.AppendChar(c);
ctx.Credentials = new SharePointOnlineCredentials(login, pwd);
ctx.ExecuteQuery();
// Iterating through all the entries.
foreach (var item in items)
{
String currentID = item["ID"].ToString(); // Getting the ID of the current item.
if (!item.IsCheckedOut()) // This is the part I am looking for.
{
// Do stuff
}
else
{
Console.WriteLine("Item is blocked, skipping it.")
}
}
I have yet not been able to find something fitting.