Found it buried deep in the admin section controls! Actually, I may have missed it too, since it's in a somewhat obvious class. However, there is no documentation on this! Here it is!
Just replace the media library with the one you want, and the path to the images or whatever. In this example, I'm building a list of images.
Note: the path selector property type wont work for this, since it only work in the CMS Content Tree. This kinda sucks becuase that means you have to hand type any media library paths. Small price to pay for good functionality though.
var mediaLibraryInfo = MediaLibraryInfoProvider.GetMediaLibraryInfo(MediaLibraryName, CMSContext.CurrentSiteName);
if (mediaLibraryInfo != null)
{
string where = "FilePath LIKE '" + MediaLibraryHelper.EnsurePath(Path).Trim('/') + "%' AND FilePath NOT LIKE '" + MediaLibraryHelper.EnsurePath(Path).Trim('/') + "_%/%' AND FileLibraryID = " + mediaLibraryInfo.LibraryID;
// Get all files from current folder
var dataSet = MediaFileInfoProvider.GetMediaFiles(where, "FileName", 0, "FileID, FilePath, FileName, FileExtension, FileSize");
var builder = new StringBuilder();
foreach (DataRow row in dataSet.Tables[0].Rows)
{
var fileInfo = MediaFileInfoProvider.GetMediaFileInfo(int.Parse(row["FileId"].ToString()));
builder.AppendLine(string.Format("<img src=\"{0}\" />", MediaFileInfoProvider.GetMediaFileAbsoluteUrl(fileInfo.FileGUID, fileInfo.FileName)));
}
uxSlideshow.InnerHtml = builder.ToString();
}