コード例 #1
0
ファイル: Form1.cs プロジェクト: zhangzheng1205/ImageSource
        private void button6_Click(object sender, EventArgs e)
        {
            Tag        oldTag  = new Tag(tagListFull[textBox4.Text], textBox5.Text);
            TagFactory factory = TagFactory.getInstance();

            factory.removeTag(textBox3.Text, oldTag);
        }
コード例 #2
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);
            }
        }