Gets the array of all locks for this item.
This property must return all locks for the item including deep locks on any of the parent folders. All fields of each LockInfo structure in the array must be set.
public LockInfo[] ActiveLocks
{
get
{
int itemID = ID;
ArrayList l = new ArrayList();
SqlConnection conn = new SqlConnection(connStr);
SqlCommand cmd;
conn.Open();
try
{
cmd = conn.CreateCommand();
cmd.CommandText = "SELECT Parent FROM Repository WHERE ID = @ID";
cmd.Parameters.Add("@ID", SqlDbType.Int);
cmd.Prepare();
l.AddRange(GetLocks(ID, false)); // get all locks
while(true)
{
cmd.Parameters["@ID"].Value = itemID;
itemID = (int)cmd.ExecuteScalar();
if(itemID <= 0) break;
l.AddRange(GetLocks(itemID, true)); // get only deep locks
}
}
finally
{
conn.Close();
}
return (LockInfo[])l.ToArray(typeof(LockInfo));
}
}
ILock Interface | ITHit.WebDAV.Server Namespace