Ejemplo n.º 1
0
        public static string BuildBuddyDisplayName(IRTCBuddy2 buddy2)
        {
            Trace.WriteLine("Entering RTCHelp.BuildBuddyDisplayName");

            RTC_PRESENCE_STATUS presenceStatus = buddy2.Status;
            string name = RTCHelp.GetBuddyName(buddy2);

            if (name == null || name.Length == 0)
            {
                Trace.WriteLine("NULL Buddy Name");
                return(null);
            }

            return(RTCHelp.BuildDisplayName(name, presenceStatus));
        }
Ejemplo n.º 2
0
        public static ArrayList BuildDeviceDisplayNameList(IRTCBuddy2 buddy2)
        {
            Trace.WriteLine("Entering RTCHelp.BuildDeviceDisplayNameList");

            ArrayList           deviceList = new ArrayList();
            string              deviceName;
            RTC_PRESENCE_STATUS deviceStatus;

            try
            {
                IRTCCollection deviceCollection = buddy2.PresenceDevices;

                foreach (IRTCPresenceDevice device in deviceCollection)
                {
                    try
                    {
                        deviceName = device.get_PresenceProperty(RTC_PRESENCE_PROPERTY.RTCPP_DEVICE_NAME);
                    }
                    catch (COMException)
                    {
                        deviceName = "NOT EXIST";
                        Trace.WriteLine("NULL Device Name");
                        continue;
                    }

                    try
                    {
                        deviceStatus = device.Status;
                    }
                    catch (COMException)
                    {
                        deviceStatus = RTC_PRESENCE_STATUS.RTCXS_PRESENCE_OFFLINE;
                    }

                    string deviceDisplayName = RTCHelp.BuildDisplayName(deviceName, deviceStatus);
                    deviceList.Add(deviceDisplayName);
                }
            }
            catch (COMException)
            {
                return(null);
            }

            return(deviceList);
        }