Пример #1
0
        private void UpdateTagsList()
        {
            this.lvTags.ItemChecked -= new System.Windows.Forms.ItemCheckedEventHandler(this.LVTagsItemChecked);
            lvTags.BeginUpdate();
            lvTags.Items.Clear();
            try {
                int num = PIAPI32.piut_isconnected();
                if (num != 1)
                {
                    PIBUtils.ShowError("Not connection");
                }
                else
                {
                    string text = cmbTagSearch.Text;

                    string tagname;
                    int    found, pt, numfound;

                    num = PIAPI32.pipt_wildcardsearchex(text, 0, out found, out tagname, out pt, out numfound);
                    while (numfound >= 1)
                    {
                        int ptNum;
                        if (PIAPI32.pipt_findpointex(tagname, out ptNum) == 0)
                        {
                            ListViewItem item = lvTags.Items.Add(tagname);
                            string       desc;
                            PIAPI32.pipt_descriptorex(ptNum, out desc);
                            item.SubItems.Add(desc);
                            item.Tag = ptNum;
                        }

                        num = PIAPI32.pipt_wildcardsearchex(text, 1, out found, out tagname, out pt, out numfound);
                        Application.DoEvents();
                    }
                }
            } finally {
                lvTags.EndUpdate();
                this.lvTags.ItemChecked += new System.Windows.Forms.ItemCheckedEventHandler(this.LVTagsItemChecked);
                UpdateStatusBar();
            }
        }