예제 #1
0
        public DashboardItem(dynamic obj)
        {
            if (obj.id != null)
            {
                Id = obj.id;
            }
            HeaderText = obj.header_text;
            Type       = obj.type;
            SortOrder  = obj.sort_order;
            switch (Type)
            {
            case "simple":
                Body = new SimpleDashboardBody(obj.body);
                break;

            case "list":
                Body = new ListDashboardBody(obj.body);
                break;

            case "horizontal_bar":
                Body = new HorizontalBarChartDashboardBody(obj.body);
                break;

            default:
                Body = null;
                break;
            }
        }
예제 #2
0
        public DashboardItem(Entity entity)
        {
            Id         = entity.Key.Path.First().Id;
            HeaderText = (string)entity["header_text"];
            Type       = (string)entity["type"];
            SortOrder  = (int)entity["sort_order"];
            switch (Type)
            {
            case "simple":
                Body = new SimpleDashboardBody((Entity)entity["body"]);
                break;

            case "list":
                Body = new ListDashboardBody((Entity)entity["body"]);
                break;

            case "horizontal_bar":
                Body = new HorizontalBarChartDashboardBody((Entity)entity["body"]);
                break;

            default:
                Body = null;
                break;
            }
        }