Пример #1
0
        private void listBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            m_Preperty.Clear();
            int nIndex = listBox1.SelectedIndex;

            if (nIndex < 0)
            {
                return;
            }
            int    nInfo       = m_ListInfo[nIndex];
            string strLabel    = null;
            string strTextBox  = null;
            string strFuncName = listBox1.Items[nIndex].ToString();
            int    nNum        = 0;

            m_RecordPlayer.GetInformation(nInfo, out strLabel, out strTextBox, out nNum);

            int i = 0, nLabelIndex = 0, nTextBoxIndex = 0;
            int nLabelLength   = strLabel.Length;
            int nTextBoxLength = strTextBox.Length;

            string subLabel = null, subTextBox = null;

            for (i = 0; i < nNum; i++)
            {
                subLabel = null;
                for (; nLabelIndex < nLabelLength; nLabelIndex++)
                {
                    if (strLabel[nLabelIndex] == ' ')
                    {
                        break;
                    }
                    subLabel += strLabel[nLabelIndex];
                }
                nLabelIndex++;

                subTextBox = null;
                for (; nTextBoxIndex < nTextBoxLength; nTextBoxIndex++)
                {
                    if (strTextBox[nTextBoxIndex] == ' ')
                    {
                        break;
                    }
                    subTextBox += strTextBox[nTextBoxIndex];
                }
                nTextBoxIndex++;
                CustomProperty myPreperty = new CustomProperty(strFuncName, subLabel, subTextBox, false, true);
                m_Preperty.Add(myPreperty);
            }
            propertyGrid1.Refresh();
        }