private IResourceBundle GetBundle(TagModel model) { IResourceBundle bundle; if (Bundle != null) { var bundleName = GetAsString(Bundle, model); bundle = (IResourceBundle)model[bundleName]; if (bundle == null) { throw TagException.NoResourceBundleFoundUnder(bundleName).Decorate(Bundle.Context); } } else { bundle = (IResourceBundle)model.SearchInTagScope(FormatConstants.BUNDLE); bundle = bundle ?? (IResourceBundle)model.Global[FormatConstants.BUNDLE]; if (bundle == null) { throw TagException.NoResourceBundleFoundInTagScope().Decorate(Context); } } return(bundle); }