Exemplo n.º 1
0
        /// <summary>
        /// Handler for the Availability changes. Used to publish the selected availability value in Lync
        /// </summary>
        public void UpdateLyncAvailability(LyncAvailabilityState state)
        {
            //Add the availability to the contact information items to be published
            Dictionary <PublishableContactInformationType, object> newInformation =
                new Dictionary <PublishableContactInformationType, object>();

            newInformation.Add(PublishableContactInformationType.Availability, state);

            //Publish the new availability value
            try {
                _lyncClient.Self.BeginPublishContactInformation(newInformation, PublishContactInformationCallback, null);
            }
            catch (LyncClientException lyncClientException) {
                Console.WriteLine(lyncClientException);
            }
            catch (SystemException systemException) {
                if (IsLyncException(systemException))
                {
                    // Log the exception thrown by the Lync Model API.
                    Console.WriteLine("Error: " + systemException);
                }
                else
                {
                    // Rethrow the SystemException which did not come from the Lync Model API.
                    throw;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Handler for the Availability changes. Used to publish the selected availability value in Lync
        /// </summary>
        public void UpdateLyncAvailability(LyncAvailabilityState state)
        {
            //Add the availability to the contact information items to be published
            Dictionary<PublishableContactInformationType, object> newInformation =
                new Dictionary<PublishableContactInformationType, object>();
            newInformation.Add(PublishableContactInformationType.Availability, state);

            //Publish the new availability value
            try {
                _lyncClient.Self.BeginPublishContactInformation(newInformation, PublishContactInformationCallback, null);
            }
            catch (LyncClientException lyncClientException) {
                Console.WriteLine(lyncClientException);
            }
            catch (SystemException systemException) {
                if (IsLyncException(systemException)) {
                    // Log the exception thrown by the Lync Model API.
                    Console.WriteLine("Error: " + systemException);
                }
                else {
                    // Rethrow the SystemException which did not come from the Lync Model API.
                    throw;
                }
            }
        }