private static bool UpdateCategories(ArrayList categories, ArrayList storedCategories, IEMAPIProp message) { bool changes = false; if (storedCategories == null && categories == null) { changes = false; } else if (storedCategories != null && categories != null && categories.Count != storedCategories.Count) { changes = true; } else if (storedCategories == null && categories != null && categories.Count > 0) { changes = true; } else if (categories == null && storedCategories != null && storedCategories.Count > 0) { changes = true; } if (storedCategories != null && !changes) { storedCategories.Sort(); categories.Sort(); for (int i = 0; i < categories.Count; i++) { if ((string)categories[i] != (string)storedCategories[i]) { changes = true; break; } } } if (changes) { _tracer.Trace("TO BE EXPORT FOR CATEGORIES"); _tracer.Trace("Old categories:"); if (storedCategories != null) { foreach (string str in storedCategories) { _tracer.Trace(str); } } _tracer.Trace("New categories:"); if (categories != null) { foreach (string str in categories) { _tracer.Trace(str); } } _tracer.Trace("TO BE EXPORT FOR CATEGORIES END"); OutlookSession.SetCategories(message, categories); } return(changes); }
private static bool RemoveCategories(ArrayList storedCategories, IEMAPIProp message) { if (storedCategories != null) { OutlookSession.SetCategories(message, null); return(true); } return(false); }