public IList<Tag> GetTags(Outlook.MailItem mailItem) { var existingTags=new List<Tag>(); if(!MailHelper.HasUserProperty(mailItem,PropName)) { return null; } var propValue=MailHelper.GetUserProperty(mailItem, PropName); var propString = propValue != null ? propValue.ToString() : string.Empty; propString.Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries).ToList().ForEach(delegate(string str) { var strBroken = str.Split(new string[]{"."},StringSplitOptions.RemoveEmptyEntries); var tg = new Tag() { TagSource = strBroken[0], TagName = strBroken[1] }; existingTags.Add(tg); }); return existingTags; }
public string ParseToString(Tag tag) { return string.Format(CultureInfo.InvariantCulture, "{0}.{1}", tag.TagSource, tag.TagName); }