static void ReadData(NodeReference node)
 {
     try
     {
         node.AppendSubscript("");
         string subscr = node.NextSubscript();
         while (!subscr.Equals(""))
         {
             node.SetSubscript(node.GetSubscriptCount(), subscr);
             if (node.HasData())
             {
                 Console.Write(" ".PadLeft(node.GetSubscriptCount() * 4, '-') + subscr + "  ->  ");
                 GetData(node);
             }
             if (node.HasSubnodes())
             {
                 ReadData(node);
             }
             subscr = node.NextSubscript();
         }
     }
     catch (GlobalsException ex)
     {
         Console.WriteLine(ex.Message);
     }
     finally
     {
         node.SetSubscriptCount(node.GetSubscriptCount() - 1);
     }
 }
Example #2
0
        public List <string> PropertyNames()
        {
            List <string> working_list   = new List <string>();
            string        loop_subscript = _DocNodeRef.NextSubscript("");

            while (loop_subscript != "")
            {
                try
                {
                    if (_DocNodeRef.HasSubnodes(loop_subscript, VALUE_SUBSCRIPT))
                    {
                        continue;
                    }

                    working_list.Add(loop_subscript);
                }
                catch
                { }
                loop_subscript = _DocNodeRef.NextSubscript(loop_subscript);
            }
            return(working_list);
        }
Example #3
0
        public void DisplayForSubscripts(params object[] working_subscripts)
        {
            string prefix = Environment.NewLine + working_noderef.GetName();

            if (working_subscripts.Length > 0)
            {
                for (int ix = 0; ix < working_subscripts.Length; ix++)
                {
                    prefix += "[" + working_subscripts[ix].ToString() + "]";
                }
            }
            prefix += " = ";


            try
            {
                string current_val = working_noderef.GetString(working_subscripts);
                if (current_val != null)
                {
                    if (current_val != "")
                    {
                        textDocContents.AppendText(prefix + current_val);
                    }
                }
            }
            catch
            { }

            try
            {
                if (working_noderef.HasSubnodes(working_subscripts))
                {
                    int      count      = 0;
                    object[] sub_params = new object[working_subscripts.Length + 1];
                    for (int loop_index = 0; loop_index < working_subscripts.Length; loop_index++)
                    {
                        sub_params[loop_index] = working_subscripts[loop_index];
                    }

                    sub_params[working_subscripts.Length] = "";

                    string loop_sub = working_noderef.NextSubscript(sub_params);

                    while (loop_sub != "")
                    {
                        count++;
                        if (count > 10)
                        {
                            textDocContents.AppendText(Environment.NewLine + "...");
                            break;
                        }
                        sub_params[working_subscripts.Length] = loop_sub;
                        DisplayForSubscripts(sub_params);

                        loop_sub = working_noderef.NextSubscript(sub_params);
                    }
                }
            }
            catch //(Exception e)
            {
                MessageBox.Show("Error displaying data");
                return;
            }
        }