Get the correct property of a directory element, according to its resource type