Created
August 1, 2011 20:08
-
-
Save sclarson/1118877 to your computer and use it in GitHub Desktop.
Get multiple list options from pagedata property
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private MultipleOptionsListSettings GetMultipleOptionsListItemsForProperty(string propertyName) | |
{ | |
IPropertySettingsRepository settingsRepository = new PropertySettingsRepository(); | |
PropertySettingsContainer container; | |
PageData dummyModel = DataFactory.Instance.GetDefaultPageData(SiteSettings.ModelRoot, "Model Page"); | |
if (settingsRepository.TryGetContainer(dummyModel.Property[propertyName].SettingsID, out container)) | |
{ | |
var wrapper = new PropertySettingsWrapper(); | |
foreach (PropertySettingsWrapper wrap in container.Settings.Values) | |
{ | |
if (wrap.PropertySettings.GetType() == typeof(MultipleOptionsListSettings)) | |
{ | |
wrapper = wrap; | |
break; | |
} | |
} | |
return wrapper.PropertySettings as MultipleOptionsListSettings; | |
} | |
return null; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment