Beispiel #1
0
        private void LoadAllAddress()
        {
            _search = false;

            var data = new List <PcGroupAddress>();

            foreach (var it in MyCache.GroupAddressTable)
            {
                //if (((AddressType.Read == this.PickType) && (it.IsCommunication && it.IsRead)) ||
                //    ((AddressType.Write == this.PickType) && (it.IsCommunication && it.IsWrite)))
                //{
                if (this.NeedActions && ((null == it.Actions) || (it.Actions.Count <= 0)))
                {
                    continue;
                }

                var temp = new PcGroupAddress(it);

                if (SelectedAddress != null && SelectedAddress.ContainsKey(temp.Id))
                {
                    temp.Selected     = true;
                    temp.DefaultValue = SelectedAddress[temp.Id].DefaultValue;
                }

                data.Add(temp);
                //}
            }

            RefreashTable(data);
        }
Beispiel #2
0
        private void SearchAddress()
        {
            _search = true;

            string searchText = this.txtSearch.Text.Trim();

            if (!string.IsNullOrWhiteSpace(searchText))
            {
                var data = new List <PcGroupAddress>();

                var filterAddress = from i in MyCache.GroupAddressTable where i.Name.IndexOf(searchText, StringComparison.OrdinalIgnoreCase) != -1 select i;

                foreach (var it in filterAddress)
                {
                    var temp = new PcGroupAddress(it);

                    if (SelectedAddress != null && SelectedAddress.ContainsKey(temp.Id))
                    {
                        temp.Selected = true;
                    }

                    data.Add(temp);
                }

                RefreashTable(data);
            }
        }
Beispiel #3
0
        private void FrmGroupAddressPick_Load(object sender, EventArgs e)
        {
            foreach (EdGroupAddress address in MyCache.GroupAddressTable)
            {
                var temp = new MgGroupAddress(address);
                this.MgAddressList.Add(temp);

                if ((null != SelectedAddress) && (SelectedAddress.ContainsKey(address.Id)))
                {
                    temp.IsSelected   = true;
                    temp.DefaultValue = SelectedAddress[address.Id].DefaultValue;
                }
            }

            LoadAllAddress();
        }