Exemplo n.º 1
0
        //remove an existing tagtype from the list, and from the xml file
        //this will remove all existing tags of this type!
        public void removeTagType(string tagType)
        {
            if (tagTypeList.ContainsKey(tagType))
            {
                TagType type = tagTypeList[tagType];
                foreach (KeyValuePair <string, Dictionary <string, Tag> > kvp in tagList)
                {
                    if (kvp.Value.ContainsKey(type.name))
                    {
                        //remove the tag from the specified image.
                        //this should be fixed to a more generic search for all images?
                        tagFactory.removeTag(kvp.Key, kvp.Value[type.name]);
                        kvp.Value.Remove(type.name);
                    }
                }

                tagTypeList.Remove(type.name);
                tagFactory.removeTagType(type);
            }
        }
Exemplo n.º 2
0
        private void button2_Click(object sender, EventArgs e)
        {
            TagFactory factory = TagFactory.getInstance();

            factory.removeTagType(new TagType(Int16.Parse(textBox2.Text), textBox1.Text));
        }