} // end of c'tor /* * public void AddItem(string text, bool check) * { * tagList.AddItem(text, check, null); * } // end of AddItem() * * public void AddItem(string text, bool check, object obj) * { * tagList.AddItem(text, check, obj); * } // end of AddItem() */ /// <summary> /// Initializes the current state of the tag picker to match the passed in tags. /// </summary> /// <param name="tags"></param> public void SetTags(int curTags) { for (int i = 0; i < tagList.NumItems; i++) { ModularCheckboxList.CheckboxItem item = tagList.GetItem(i); item.Check = (curTags & (int)(Genres)item.Obj) != 0; } } // end of SetTags()
} // end of SetTags() /// <summary> /// Returns the current state of the tag picker. /// </summary> /// <returns></returns> public int GetTags() { int tags = 0; for (int i = 0; i < tagList.NumItems; i++) { ModularCheckboxList.CheckboxItem item = tagList.GetItem(i); if (item.Check) { tags |= (int)(Genres)item.Obj; } } return(tags); } // end of GetTags()