示例#1
0
        private void TagRemoveExcuted()
        {
            List <TagItem> toberemoved = new List <TagItem>();

            foreach (TagItem tag in selectedTags)
            {
                toberemoved.Add(tag);
            }
            foreach (TagItem tag in toberemoved)
            {
                if (tag.Tag.TagID != null)
                {
                    TagRemoved(tag.Tag, tagRemovedCallBack);
                }

                tags.Remove(tag);
            }
        }
示例#2
0
        public void GivenEmptyCollection_WhenRemovingTag_ThenNothingHappens()
        {
            // Arrange

            // Act
            _tags.Remove <string>();

            // Assert
            Assert.That(_tags.GetCount <string>(), Is.Zero);
        }
示例#3
0
 private void TagRemoved(string tag)
 {
     foreach (var item in TagCollection)
     {
         if (item.Text == tag)
         {
             item.Count--;
             if (item.Count < 1)
             {
                 TagCollection.Remove(item);
             }
             return;
         }
     }
 }
示例#4
0
        public TagData Set(TagInfo source,
                           string protocol = InventoryInfo.ISO15693)
        {
            var tag   = this.Build(source, protocol);
            var exist = FindTag(source.UID, null);

            if (exist == null)
            {
                _tags.Add(tag);
            }
            else
            {
                _tags.Remove(exist);
                _tags.Add(tag);
            }

            return(tag);
        }