In EpiServer, If an item is not being "used" or placed inside a contentarea, EpiServer marks the item as "The item is not in use", like this:
I have a contentarea where one can point out a media folder and it will list all files under that root, like this:
private IEnumerable<MediaData> GetMediaDataFilesFromRoot(ContentReference folder)
{
if (folder == null)
{
return new List<MediaData>();
}
return contentLoader.GetDescendantsOfType<MediaData>(folder);
}
. The problem is that when listing files from a root instead of "dragging and dropping" them onto the contentarea itself, is that EpiServer will not detect the files as "being in use". However, when I drop a file directly to the contentarea it gets marked as in use. Is it possible to modify this setting programmatically so all of the children files of my desired root will get marked as "in use" as well?