Exemplo n.º 1
0
        private void OnConversationActionAvailabilityChanged(object sender, ConversationActionAvailabilityEventArgs e)
        {
            //posts the execution into the UI thread
            RunAtUI
                (() =>
            {
                //each action is mapped to a button in the UI
                switch (e.Action)
                {
                case ConversationAction.AddParticipant:
                    IsCanAddParticipant = e.IsAvailable;
                    break;

                case ConversationAction.RemoveParticipant:
                    ParticipantCollection.UpdateCanRemoveParticipant(Conversation.CanInvoke(ConversationAction.RemoveParticipant));
                    _log.Debug("OnConversationActionAvailabilityChanged  CanRemove:{0}"
                               , Conversation.CanInvoke(ConversationAction.RemoveParticipant));
                    break;
                }
                _log.Debug("OnConversationActionAvailabilityChanged  Send:{2} Action: {0}  IsAvailable:{1} "
                           , e.Action.ToString()
                           , e.IsAvailable
                           , sender);
            }
                );
        }
Exemplo n.º 2
0
        //*****************************************************************************************
        //                              Conversation Event Handling
        //
        // The ability to add or remove a participant to/from the conversation will change over the
        // life-cycle of the conversation. This will informed through the ActionAvailabilityChanged
        // events.
        //
        // Whenever a participant joins or exits the conversation, events ParticipantAdded or
        // ParticipantRemoved will be raised. Those will occur either by an action taken at this
        // endpoint or any other participant in the conversation. For example, a ParticipantAdded
        // may be fired because the other side of the conversation added a new contact to the
        // conversation.
        //
        //*****************************************************************************************

        /// <summary>
        /// Called when the availability of an action changes.
        ///
        /// Will Enable/Disable buttons based off the availability.
        /// </summary>
        void conversation_ActionAvailabilityChanged(object sender, ConversationActionAvailabilityEventArgs e)
        {
            //posts the execution into the UI thread
            this.BeginInvoke(new MethodInvoker(delegate()
            {
                //each action is mapped to a button in the UI
                switch (e.Action)
                {
                case ConversationAction.AddParticipant:
                    buttonAddRosterContact.Enabled = e.IsAvailable;
                    break;

                case ConversationAction.RemoveParticipant:
                    buttonRemoveRosterContact.Enabled = e.IsAvailable;
                    break;
                }
            }));
        }
Exemplo n.º 3
0
 void conversation_ActionAvailabilityChanged(object sender, ConversationActionAvailabilityEventArgs e)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 4
0
 static void Conversation_ActionAvailabilityChanged(object sender, ConversationActionAvailabilityEventArgs e)
 {
     Trace.WriteLine($"{GetRunningMethodName}:{e.Action}");
 }