If you'd like to create a Sitefinity CMS library in code, you reference the Telerik.Libraries DLL and work with the Telerik.Libraries.LibraryManager. In the example below, we check for the existence of the library and if it doesn't already exist, then we create a new library, apply property settings, then with the Library Manager, we save the library to commit it.
Dim libThumbnail As Telerik.Libraries.ILibrary Dim mgrLibrary As New Telerik.Libraries.LibraryManager() Dim strLibraryName As String = "Thumbnail" libThumbnail = mgrLibrary.GetLibrary(strLibraryName) If IsNothing(libThumbnail) Then libThumbnail = mgrLibrary.CreateLibrary() With libThumbnail .Name = strLibraryName .TypeName = "Image" .Expiration.Value = 0 End With mgrLibrary.SaveLibrary(libThumbnail) End If
RadEditor - please enable JavaScript to use the rich text editor.
I often get asked why I'm willing to journal all of my Sitefinity discoveries. People think I'm insane to give away for free what I labored over at some point.
Let me answer that in 2 parts:
Talk to us about how we can help YOU!
Keep up with our Sitefinity discoveries! Click on the RSS feed icon below or sign up for our newsletter.