Esempio n. 1
0
        public override object GetData(ITabContext context)
        {
            var plugin = Plugin.Create("Function", "Param", "Type");

            try
            {
                string url    = System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
                int    NodeId = -1;

                if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request["glimpse7GetMediaById"]))
                {
                    Int32.TryParse(System.Web.HttpContext.Current.Request["glimpse7GetMediaById"], out NodeId);
                }
                if (NodeId > 0)
                {
                    dynamic mediaItem = new DynamicMedia(NodeId);
                    return(UmbracoFn.showMethodsValue(mediaItem, "media"));
                }
                else
                {
                    return(UmbracoFn.showMethods(typeof(DynamicMedia)));
                }
            }

            catch (Exception ex)
            {
                plugin.AddRow().Column(ex.ToString());
            }

            return(plugin);
        }
        public override object GetData(ITabContext context)
        {
            var plugin = Plugin.Create("Function", "Param", "Type");

            try
            {
                string url    = System.Web.HttpContext.Current.Request.Url.AbsoluteUri;
                int    NodeId = 0;
                if (System.Web.HttpContext.Current.Request["glimpse7GetCheatSheet"] == "true")
                {
                    return(UmbracoFn.showMethods(typeof(DynamicPublishedContent)));
                }
                if (!string.IsNullOrEmpty(System.Web.HttpContext.Current.Request["glimpse7GetContentById"]))
                {
                    Int32.TryParse(System.Web.HttpContext.Current.Request["glimpse7GetContentById"], out NodeId);
                }
                else if (umbraco.presentation.UmbracoContext.Current.PageId != null)
                {
                    NodeId = umbraco.presentation.UmbracoContext.Current.PageId.Value;
                }
                else
                {
                    return(UmbracoFn.showMethodsValue(typeof(DynamicPublishedContent), "content"));
                }

                var umbracoHelper         = new UmbracoHelper(UmbracoContext.Current);
                IPublishedContent content = umbracoHelper.TypedContent(NodeId);
                var node = new Umbraco.Web.Models.DynamicPublishedContent(content);
                return(UmbracoFn.showMethodsValue(node, "content"));
            }

            catch (Exception ex)
            {
                plugin.AddRow().Column(umbraco.presentation.UmbracoContext.Current.PageId);
            }

            return(plugin);
        }