Esempio n. 1
0
        private FComment getFormInstance()
        {
            var instance = new FComment();

            instance.ByUser = Session.CurrentUser;
            return(instance);
        }
Esempio n. 2
0
        public bool ProcessChatMessage(ChatMessage chatMessage)
        {
            FComment form  = null;
            var      found = _instances.TryGetValue(chatMessage.GetCommentKey(), out form);

            if (found)
            {
                form.DisplayComment(chatMessage);
            }

            return(found);
        }
Esempio n. 3
0
        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);
        }
Esempio n. 4
0
        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);
        }
Esempio n. 5
0
        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);
        }