public IMenuRegion CreateRegion(IMenuRegionProfile profile, bool skipWrappingObject) { var profileType = profile.GetType(); if (!ProfileMapping.ContainsKey(profileType)) { throw new MenuException("Could not find a mapped object for type {0}.", profileType.Name); } var type = ProfileMapping[profileType]; if (!skipWrappingObject && profile is IObjectProfileWithText && !string.IsNullOrEmpty(((IObjectProfileWithText)profile).text)) { type = typeof(BaseObjectWithTextLabel); } return(this.CreateRegion(profile, skipWrappingObject, type)); }
public IMenuRegion CreateRegion(IMenuRegionProfile profile, bool skipWrappingObject, Type specificType) { return((IMenuRegion)this.RecyclePool.Retrieve(specificType)); }
public IMenuRegion CreateRegion(IMenuRegionProfile profile) { return(this.CreateRegion(profile, false)); }