private FComment getFormInstance() { var instance = new FComment(); instance.ByUser = Session.CurrentUser; return(instance); }
public bool ProcessChatMessage(ChatMessage chatMessage) { FComment form = null; var found = _instances.TryGetValue(chatMessage.GetCommentKey(), out form); if (found) { form.DisplayComment(chatMessage); } return(found); }
public FComment GetAccountCommentForm(Account account) { FComment instance = null; var key = composeKey(CommentType.Account, account.Id); var found = _instances.TryGetValue(key, out instance); if (found) { return(instance); } instance = getFormInstance(); instance.Account = account; _instances.Add(key, instance); return(instance); }
public FComment GetContactCommentForm(Contact contact) { FComment instance = null; var key = composeKey(CommentType.Contact, contact.ContactUserId); var found = _instances.TryGetValue(key, out instance); if (found) { return(instance); } instance = getFormInstance(); instance.ToUser = IntuneService.GetUserById(contact.ContactUserId); _instances.Add(key, instance); return(instance); }
public void RemoveForm(FComment instance) { string key = ""; if (instance.Entry != null) { key = composeKey(CommentType.Entry, instance.Entry.Id); } else if (instance.Account != null) { key = composeKey(CommentType.Account, instance.Account.Id); } else { key = composeKey(CommentType.Contact, instance.ToUser.Id); } _instances.Remove(key); }