private void UpdateTagList() { tagListBox.Items.Clear(); String categoryText = (String)categoryListBox.SelectedItem; int stringLen = AssetTagging.AssetTagging_MaxStringLen(); int tagCount = AssetTagging.AssetTagging_GetNumTagsForCategory(categoryText, (String)projectSelectionComboBox.SelectedItem); IntPtr[] buffer = AssetTagging.Marshal2DToArray(tagCount, stringLen); int tagRet = AssetTagging.AssetTagging_GetTagsForCategory(categoryText, (String)projectSelectionComboBox.SelectedItem, buffer, tagCount); String[] output = AssetTagging.MarshalBufferToStringArray(buffer, tagRet); foreach (String str in output) { tagListBox.Items.Add(str); } }
private void removeCategoryButton_Click(object sender, System.EventArgs e) { foreach( String category in categoryListBox.SelectedItems ) { int stringLen = AssetTagging.AssetTagging_MaxStringLen(); int tagCount = AssetTagging.AssetTagging_GetNumTagsForCategory(category, (String)projectSelectionComboBox.SelectedItem); IntPtr[] buffer = AssetTagging.Marshal2DToArray(tagCount, stringLen); int tagRet = AssetTagging.AssetTagging_GetTagsForCategory(category, (String)projectSelectionComboBox.SelectedItem, buffer, tagCount); String[] output = AssetTagging.MarshalBufferToStringArray(buffer, tagRet); foreach (String str in output) { RemoveTag(str); } RemoveCategory(category); } UpdateCategoriesList(); UpdateTagList(); }