I am building a web part that would be added to the bottom of every library view and would display the folder content types making it easy to create a new folder (rather than having to go to documents - new document and then select from a drop-down).
My first attempt used
foreach(SPContentType type in list.ContentTypes)
This works but it gives me the content types in some sort of default order that has nothing to do with the order I set in the New Document button.
My next attempt I used
SPFolder folder = web.GetFolder(Request.RawUrl); foreach(SPContentType type in folder.ContentTypeOrder)
This also works but gives me the exact same order as the first attempt even though I have unique new button orders set for each folder type in the library.
So how do I get the order in which items appear on the new button?