Ejemplo n.º 1
0
        private bool disposedValue = false; // Pour détecter les appels redondants

        /// <summary>
        /// Releases unmanaged and - optionally - managed resources.
        /// </summary>
        protected override void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    // TODO: supprimer l'état managé (objets managés).
                }

                // TODO: libérer les ressources non managées (objets non managés) et remplacer un finaliseur ci-dessous.
                // TODO: définir les champs de grande taille avec la valeur Null.
                AllConversations     = null;
                SelectedConversation = null;

                disposedValue = true;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Selects the conversation using the list of contact if it was not instanciated yet.
        /// Modification of the selected conversation must use this fonction
        /// </summary>
        /// <param name="contact">The contact to chat with.</param>
        public void SelectConversation(UserViewModel contact)
        {
            if (contact != null)
            {
                var conversation = FindByJid(contact.Jid);

                if (conversation != null)
                {
                    SelectedConversation = conversation;
                }

                else
                {
                    conversation = new Conversation(contact);
                    AllConversations.Add(conversation);
                    SelectedConversation = conversation;
                }
            }
        }