Telerik.Web.Mvc.UI.WebAssetItemCollectionBuilder.GetGroup C# (CSharp) Method

GetGroup() public method

Executes the provided delegate that is used to configure the group fluently.
public GetGroup ( string name, Action configureAction ) : WebAssetItemCollectionBuilder
name string The name.
configureAction Action The configure action.
return WebAssetItemCollectionBuilder
        public virtual WebAssetItemCollectionBuilder GetGroup(string name, Action<WebAssetItemGroupBuilder> configureAction)
        {
            Guard.IsNotNullOrEmpty(name, "name");
            Guard.IsNotNull(configureAction, "configureAction");

            WebAssetItemGroup itemGroup = assets.FindGroupByName(name);

            if (itemGroup == null)
            {
                throw new ArgumentException(TextResource.GroupWithSpecifiedNameDoesNotExistPleaseMakeSureYouHaveSpecifiedACorrectName.FormatWith(name));
            }

            if (itemGroup.IsShared)
            {
                throw new InvalidOperationException(TextResource.YouCannotConfigureASharedWebAssetGroup);
            }

            WebAssetItemGroupBuilder builder = new WebAssetItemGroupBuilder(itemGroup);

            configureAction(builder);

            return this;
        }