public bool TryAddCategory(int projectId, int tagId, string categoryName) { if (this.IsInvalidCategoryName(categoryName)) { return(false); } Outlook.Category outlookCategory = this.EnsureOutlookCategoryExists(categoryName); CategoryList categoryList = new CategoryList(Properties.Settings.Default.CategoriesString, this.OutlookCategories); categoryList.AddOrUpdate(new Category(categoryName, projectId, tagId, outlookCategory)); Properties.Settings.Default.CategoriesString = categoryList.ItemsAsXmlString; Properties.Settings.Default.Save(); return(true); }