override public void Expand()
        {
            if (Expanded)
            {
                return;
            }

            if (!HasJSon)
            {
                return;
            }

            PreInserts();

            if (m_json.ID.Length > 0)
            {
                RscViewer_JSon_TreeLbItem ti = new RscViewer_JSon_TreeLbItem(Holder, this);
                ti.DetailsOnly = "RscJSonItem.ID" + ": " + m_json.ID;

                Insert(ti);
            }
            if (m_json.Description.Length > 0)
            {
                RscViewer_JSon_TreeLbItem ti = new RscViewer_JSon_TreeLbItem(Holder, this);
                ti.DetailsOnly = "RscJSonItem.Description" + ": " + m_json.Description;

                Insert(ti);
            }

            for (int i = 0; i < m_json.PropertyCount; i++)
            {
                RscJSonItemProperty oProp = m_json.GetProperty(i);

                RscViewer_JSon_TreeLbItem ti = new RscViewer_JSon_TreeLbItem(Holder, this);
                ti.DetailsOnly = oProp.Name + ": " + oProp.Value(false);

                Insert(ti);
            }

            for (int i = 0; i < m_json.ChildCount; i++)
            {
                RscJSonItem oChild = m_json.GetChild(i);

                RscViewer_JSon_TreeLbItem ti = new RscViewer_JSon_TreeLbItem(Holder, this);
                ti.m_json = oChild;

                Insert(ti);
            }

            base.Expand();
        }
Exemple #2
0
        private void DoExpColl(object sender)
        {
            Button btn = (Button)sender;
            RscViewer_JSon_TreeLbItem ti = (RscViewer_JSon_TreeLbItem)btn.Tag;

            if (ti.Expanded)
            {
                ti.Collapse();
            }
            else
            {
                if (ti.HasJSon)
                {
                    ti.Expand();
                }
            }
        }
Exemple #3
0
        private void LoadContent( )
        {
            string sContent = m_sContent_TEMP;

            m_sContent_TEMP = "";

            m_aLines.Text = sContent;

            string      sErr = "";
            RscJSonItem json = RscJSon.FromResponseContetn(sContent, out sErr);

            if (sErr.Length > 0)
            {
                LogError(sErr);
            }

            RscViewer_JSon_TreeLbItem ti = new RscViewer_JSon_TreeLbItem(m_aTI, null);

            m_aTI.Add(ti);

            ti.SetJSon(json);
        }