예제 #1
0
        public IViewComponentResult Invoke(AdPosition position)
        {
            IAdType ad             = null;
            var     positionString = position.ToString();

            if (_bunIpConfig.Ad != null)
            {
                ad = typeof(Configs.BunIpConfigs.Ad).GetProperty(positionString).GetValue(_bunIpConfig.Ad) as IAdType;
            }

            var model = new ViewModel
            {
                Ad       = ad,
                Position = position
            };

            return(View(model));
        }
예제 #2
0
 /// <summary>Static getter for Ad</summary>
 public static IPublishedContent GetAd(IAdType that)
 {
     return(that.GetPropertyValue <IPublishedContent>("ad"));
 }