Пример #1
0
        public override string GetDesignTimeHtml()
        {
            TreeView component = (TreeView)base.Component;

            component.Controls.Clear();
            component.ClearHeaders();
            component.AddHeader("DateTime Header", "yyyy-MM-dd", typeof(DateTime), "val1", "center");
            component.AddHeader("Double Header (currency)", "c", typeof(double), "val2", "right");
            component.AddHeader("Double Header", "n", typeof(double), "val3", "right");
            component.AddHeader("String Header", "", typeof(string), "val4", "left");
            TreeNode node = component.AddNode("Test Node 1", "n1", true);

            node.AddTaggedValue("val1", "1/1/2001");
            node.AddTaggedValue("val2", "90873");
            node.AddTaggedValue("val3", "90873");
            node.AddTaggedValue("val4", "Hello!");
            TreeNode node2 = component.AddNode("Test Node 2", "n2", true);

            node2.AddTaggedValue("val1", "1/1/2001");
            node2.AddTaggedValue("val2", "90873");
            node2.AddTaggedValue("val3", "90873");
            node2.AddTaggedValue("val4", "Hello!");
            node.AddNode("Sub-node", "s1", false);
            node.AddNode("Sub-node", "s2", false);
            node2.AddNode("Sub-node", "s3", true);
            node2.AddNode("Sub-node", "s4", true);
            component.ExpandAll();
            StringWriter   writer  = new StringWriter();
            HtmlTextWriter writer2 = new HtmlTextWriter(writer);

            component.RenderControl(writer2);
            return(writer.ToString());
        }
        public override View CreateNodeView(TreeNode node, Java.Lang.Object value)
        {
            var  inflater = Application.Context.GetSystemService(Context.LayoutInflaterService) as LayoutInflater;
            View view     = inflater.Inflate(Resource.Layout.layout_icon_node, null, false);

            var iconTreeItem = value.JavaCast <IconTreeItem>();

            var tvValue = view.FindViewById <TextView>(Resource.Id.node_value);

            tvValue.Text = iconTreeItem.Text;

            PrintView iconView = view.FindViewById <PrintView>(Resource.Id.icon);

            iconView.SetIconText(iconTreeItem.Icon);

            arrowView = view.FindViewById <PrintView>(Resource.Id.arrow_icon);

            view.FindViewById(Resource.Id.btn_addFolder).Click += (sender, e) => {
                TreeNode newFolder = new TreeNode(new IconTreeItem(Resource.String.ic_folder, "New Folder"));
                TreeView.AddNode(node, newFolder);
            };

            view.FindViewById(Resource.Id.btn_delete).Click += (sender, e) => {
                TreeView.RemoveNode(node);
            };

            //if My computer
            if (node.Level == 1)
            {
                view.FindViewById(Resource.Id.btn_delete).Visibility = ViewStates.Gone;
            }

            return(view);
        }
Пример #3
0
 protected void PopulateTree(STS sts)
 {
     sts.SemanticTypes.ForEach(t =>
     {
         object tn = TreeView.AddNode(null, t.Key, t);
         PopulateSTChildren(t.Value, tn);
     });
 }
Пример #4
0
        protected void PopulateSTChildren(ISemanticType st, object parent)
        {
            TreeView.AddNode(parent, "decl", st.Decl);
            TreeView.AddNode(parent, "struct", st.Struct);

            st.Struct.SemanticElements.ForEach(elem =>
            {
                object tn = TreeView.AddNode(parent, elem.Name, elem);
                PopulateSTChildren(elem.Element, tn);
            });
        }
Пример #5
0
        public override string GetDesignTimeHtml()
        {
            TreeView tvw = (TreeView)this.Component;

            tvw.Controls.Clear();
            tvw.ClearHeaders();
            tvw.AddHeader("DateTime Header", "yyyy-MM-dd", typeof(DateTime), "val1", "center");
            tvw.AddHeader("Double Header (currency)", "c", typeof(double), "val2", "right");
            tvw.AddHeader("Double Header", "n", typeof(double), "val3", "right");
            tvw.AddHeader("String Header", "", typeof(string), "val4", "left");

            TreeNode n1 = tvw.AddNode("Test Node 1", "n1", true);

            n1.AddTaggedValue("val1", "1/1/2001");
            n1.AddTaggedValue("val2", "90873");
            n1.AddTaggedValue("val3", "90873");
            n1.AddTaggedValue("val4", "Hello!");

            TreeNode n2 = tvw.AddNode("Test Node 2", "n2", true);

            n2.AddTaggedValue("val1", "1/1/2001");
            n2.AddTaggedValue("val2", "90873");
            n2.AddTaggedValue("val3", "90873");
            n2.AddTaggedValue("val4", "Hello!");

            n1.AddNode("Sub-node", "s1", false);
            n1.AddNode("Sub-node", "s2", false);

            n2.AddNode("Sub-node", "s3", true);
            n2.AddNode("Sub-node", "s4", true);

            tvw.ExpandAll();

            StringWriter   sw = new StringWriter();
            HtmlTextWriter tw = new HtmlTextWriter(sw);

            tvw.RenderControl(tw);

            return(sw.ToString());
        }
Пример #6
0
        public TreeNode AddNode(IXtreeNode inst, TreeNode parent)
        {
            TreeNode node = TreeView.AddNode(inst, parent);

            return(node);
        }