Esempio n. 1
0
        private IWebItem GetProduct()
        {
            var currentModule = WebItemManager.Instance[ModuleId] ?? CommonLinkUtility.GetWebItemByUrl(Context.Request.Url.AbsoluteUri);

            if (currentModule is IAddon)
            {
                return(currentModule);
            }

            var product = currentModule as IProduct;

            if (product != null)
            {
                return(product);
            }

            if (currentModule == null)
            {
                return(null);
            }

            IModule module;

            CommonLinkUtility.GetLocationByUrl(CommonLinkUtility.GetFullAbsolutePath(currentModule.StartURL), out product, out module);
            return(product);
        }