Exemplo n.º 1
0
        public static ListViewItem[] GetDriversListArray()
        {
            TAPIClass tobj = new TAPIClass();

            tobj.Initialize();
            IEnumAddress ea = tobj.EnumerateAddresses();
            ITAddress    ln;
            uint         arg3 = 0;

            ITCollection addresses = (ITCollection)tobj.Addresses;

            int cnt = addresses.Count;

            ITAddress[] ita = new TAPI3Lib.ITAddress[cnt];

            ListViewItem[] rtnList = new ListViewItem[cnt];

            for (int i = 0; i < cnt; i++)
            {
                ea.Next(1, out ln, ref arg3);
                ita[i] = ln;
                if (ln != null)
                {
                    rtnList[i]      = new ListViewItem();
                    rtnList[i].Text = ita[i].AddressName;
                }
                else
                {
                    break;
                }
            }


            return(rtnList);
        }
Exemplo n.º 2
0
        public static ListViewItem[] GetDriversListArray()
        {
            TAPIClass tobj = new TAPIClass();

            tobj.Initialize();
            IEnumAddress ea = tobj.EnumerateAddresses();
            ITAddress    ln;
            uint         arg3 = 0;

            ITCollection addresses = (ITCollection)tobj.Addresses;

            int cnt = addresses.Count;

            ITAddress[] ita = new TAPI3Lib.ITAddress[cnt];

            //  ListViewItem[] rtnList = new ListViewItem[cnt];


            List <ListViewItem> itemList = new List <ListViewItem>();

            for (int i = 0; i < cnt; i++)
            {
                ea.Next(1, out ln, ref arg3);
                ita[i] = ln;
                if (ln != null)
                {
                    if (ln.DialableAddress.ToStr().Trim() != string.Empty)
                    {
                        if (itemList.Count(c => c.Text == ita[i].DialableAddress) == 0)
                        {
                            itemList.Add(new ListViewItem(ita[i].DialableAddress));
                            //rtnList[i] = new ListViewItem();
                            //rtnList[i].Text = ita[i].DialableAddress;
                        }
                    }
                }
                else
                {
                    break;
                }
            }


            return(itemList.ToArray <ListViewItem>());
        }
Exemplo n.º 3
0
        public static IEnumerable <string> GetDriversList()
        {
            List <string> rtnList = new List <string>();

            TAPIClass tobj = new TAPIClass();

            tobj.Initialize();
            IEnumAddress ea = tobj.EnumerateAddresses();
            ITAddress    ln;
            uint         arg3 = 0;



            ITCollection addresses = (ITCollection)tobj.Addresses;

            int cnt = addresses.Count;

            ITAddress[] ita = new TAPI3Lib.ITAddress[cnt];


            for (int i = 0; i < cnt; i++)
            {
                ea.Next(1, out ln, ref arg3);
                ita[i] = ln;
                if (ln != null)
                {
                    if (ln.DialableAddress.ToStr().Trim() != string.Empty)
                    {
                        rtnList.Add(ita[i].DialableAddress.ToStr().Trim());
                    }
                }
                else
                {
                    break;
                }
            }


            return(rtnList.Distinct());
        }