예제 #1
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            int k = -1;

            TreeItem item = LocalData.dynamicList.Single(x => x.ID == ParID);

            builder.OpenElement(k++, "div");
            builder.AddAttribute(k++, "id", CompID);
            builder.AddAttribute(k++, "style", "width:400px;max-height:26px;position:relative;");

            SvgHelper1.Cmd_Render(LocalTreeFunctions.CmdCreateDynamicIcon(item), k, builder, item.ID);


            //      < img width = "24" height = "24" title = "Ready State" style = "margin:3px;" src = "icons/Connected.png" />


            int marginLeft = 0;

            if (item.HasIcon)
            {
                builder.OpenElement(k++, "img");
                builder.AddAttribute(k++, "width", "20");
                builder.AddAttribute(k++, "height", "20");
                builder.AddAttribute(k++, "src", item.IconSource);
                builder.AddAttribute(k++, "style", "position:absolute;top:0px;cursor:pointer;margin:0px;");
                builder.AddAttribute(k++, "onclick", EventCallback.Factory.Create(this, e => CmdItemSelect(item.ID)));
                builder.CloseElement();

                marginLeft = 25;
            }

            builder.OpenElement(k++, "span");


            //Console.WriteLine("abc " + item.Column + " " + DateTime.Now.ToString("mm:ss.fff"));

            if (item.IsSelected)
            {
                //Console.WriteLine("abc is selected");
                builder.AddAttribute(k++, "style", "position:absolute;top:0px;cursor:pointer;margin-left:" + marginLeft + "px;background-color:yellow;color:blue;border-style:solid;border-width:1px;border-color:red;");
            }
            else
            {
                //Console.WriteLine("abc is not selected");
                builder.AddAttribute(k++, "style", "position:absolute;top:0px;margin-left:" + marginLeft + "px;cursor:pointer;");
            }


            builder.AddAttribute(k++, "onclick", EventCallback.Factory.Create(this, e => CmdItemSelect(item.ID)));

            builder.AddContent(k++, item.Column);

            builder.CloseElement();

            builder.CloseElement();


            base.BuildRenderTree(builder);
        }
예제 #2
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            int k = 0;

            TreeItem item = LocalData.dynamicList.Single(x => x.ID == ParID);

            builder.OpenRegion(k++);
            builder.OpenElement(k++, "div");
            builder.AddAttribute(k++, "id", CompID);
            builder.AddAttribute(k++, "style", "width:400px;max-height:26px;position:relative;");

            builder.OpenRegion(k++);
            SvgHelper1.Cmd_Render(LocalTreeFunctions.CmdCreateDynamicIcon(item), 0, builder, item.ID);
            builder.CloseRegion();


            int marginLeft = 0;

            if (item.HasIcon)
            {
                builder.OpenElement(k++, "img");
                builder.AddAttribute(k++, "width", "20");
                builder.AddAttribute(k++, "height", "20");
                builder.AddAttribute(k++, "src", item.IconSource);
                builder.AddAttribute(k++, "style", "position:absolute;top:0px;cursor:pointer;margin:0px;user-select:none;");
                builder.AddAttribute(k++, "onclick", EventCallback.Factory.Create(this, e => CmdItemSelect(item.ID)));
                builder.CloseElement();

                marginLeft = 25;
            }

            builder.OpenElement(k++, "span");

            if (item.IsSelected)
            {
                builder.AddAttribute(k++, "style", "position:absolute;top:0px;cursor:pointer;margin-left:" + marginLeft + "px;background-color:yellow;color:blue;border-style:solid;border-width:1px;border-color:red;");
            }
            else
            {
                builder.AddAttribute(k++, "style", "position:absolute;top:0px;margin-left:" + marginLeft + "px;cursor:pointer;");
            }


            builder.AddAttribute(k++, "onclick", EventCallback.Factory.Create(this, e => CmdItemSelect(item.ID)));

            builder.AddContent(k++, item.Column);

            builder.CloseElement();

            builder.CloseElement();

            builder.CloseRegion();

            base.BuildRenderTree(builder);
        }
예제 #3
0
        protected override void BuildRenderTree(RenderTreeBuilder builder)
        {
            int k = 0;

            TreeItem item = parent.SourceList.Single(x => x.ID == ParID);

            builder.OpenRegion(k++);
            builder.OpenElement(k++, "div");
            builder.AddAttribute(k++, "id", CompID);
            builder.AddAttribute(k++, "class", parent.CssClasses.Div);
            builder.OpenRegion(k++);
            builder.OpenElement(k++, "div");
            builder.AddAttribute(k++, "class", "hhh");
            SvgHelper1.Cmd_Render(LocalTreeFunctions.CmdCreateDynamicIcon(parent.SourceList, item), 0, builder, item.ID);
            builder.CloseElement();
            builder.CloseRegion();



            if (!string.IsNullOrEmpty(item.IconSource))
            {
                builder.OpenElement(k++, "div");
                builder.AddAttribute(k++, "class", "hhh");
                builder.OpenElement(k++, "img");
                builder.AddAttribute(k++, "src", item.IconSource);
                builder.AddAttribute(k++, "class", parent.CssClasses.Icon);
                builder.AddAttribute(k++, "onclick", EventCallback.Factory.Create(this, e => CmdItemSelect(item.ID)));
                builder.CloseElement();
                builder.CloseElement();
            }

            builder.OpenElement(k++, "div");

            //builder.OpenElement(k++, "span");
            builder.AddAttribute(k++, "class", CmdGetSpanClass(item) + " hhh");
            builder.AddAttribute(k++, "onclick", EventCallback.Factory.Create(this, e => CmdItemSelect(item.ID)));
            builder.AddContent(k++, item.Text);
            //builder.CloseElement();
            builder.CloseElement();

            builder.CloseElement();

            builder.CloseRegion();

            base.BuildRenderTree(builder);
        }