コード例 #1
0
        void deletecontactMenuItem_Click(object sender, System.EventArgs e)
        {
            Trace.WriteLine("Entering RTCPresence.deletecontactMenuItem_Click");

            RTCTreeNode node = (RTCTreeNode)(this.buddyTree.SelectedNode);

            this.presenceCore.DoRemoveBuddy((IRTCBuddy)(node.Entity));
        }
コード例 #2
0
        void propertiesMenuItem_Click(object sender, System.EventArgs e)
        {
            Trace.WriteLine("Entering RTCPresence.propertiesMenuItem_Click");

            RTCTreeNode node   = (RTCTreeNode)(this.buddyTree.SelectedNode);
            IRTCBuddy2  buddy2 = (IRTCBuddy2)(node.Entity);

            this.ShowMessage(RTCHelp.GetBuddyProperties(buddy2), "Buddy Properties");
        }
コード例 #3
0
        public void UpdateBuddy(IRTCBuddy2 buddy2)
        {
            Trace.WriteLine("Entering RTCPresence.UpdateBuddy");

            this.UpdatePollBuddy(buddy2);

            if (buddy2.SubscriptionType == RTC_BUDDY_SUBSCRIPTION_TYPE.RTCBT_POLL)
            {
                return;
            }

            if (buddyHT.ContainsKey(buddy2))
            {
                ((TreeNode)buddyHT[buddy2]).Remove();
                buddyHT.Remove(buddy2);
            }

            string displayName = RTCHelp.BuildBuddyDisplayName(buddy2);

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

            Trace.WriteLine("Display name: " + displayName);

            RTCTreeNode buddyNode = new RTCTreeNode(displayName, buddy2);

            if (buddy2.Status == RTC_PRESENCE_STATUS.RTCXS_PRESENCE_OFFLINE)
            {
                buddyTree.Nodes[0].Nodes.Add(buddyNode);
                buddyTree.Nodes[0].Expand();
            }
            else
            {
                buddyTree.Nodes[1].Nodes.Add(buddyNode);
                buddyTree.Nodes[1].Expand();
            }
            buddyHT.Add(buddy2, buddyNode);

            ArrayList deviceDisplayNameList = RTCHelp.BuildDeviceDisplayNameList(buddy2);

            foreach (string deviceDisplayName in deviceDisplayNameList)
            {
                TreeNode deviceNode = new TreeNode(deviceDisplayName);
                buddyNode.Nodes.Add(deviceNode);
            }

            buddyNode.Expand();
        }
コード例 #4
0
        public void UpdateBuddy(IRTCBuddy2 buddy2)
        {
            Trace.WriteLine("Entering RTCPresence.UpdateBuddy");

            this.UpdatePollBuddy(buddy2);

            if (buddy2.SubscriptionType == RTC_BUDDY_SUBSCRIPTION_TYPE.RTCBT_POLL)
            {
                return;
            }

            if (buddyHT.ContainsKey(buddy2))
            {
                ((TreeNode) buddyHT[buddy2]).Remove();
                buddyHT.Remove(buddy2);
            }

            string displayName = RTCHelp.BuildBuddyDisplayName(buddy2);
            if (displayName == null || displayName.Length == 0)
            {
                Trace.WriteLine("NULL Buddy Name");
                return;
            }

            Trace.WriteLine("Display name: " + displayName);

            RTCTreeNode buddyNode = new RTCTreeNode(displayName, buddy2);
            if (buddy2.Status == RTC_PRESENCE_STATUS.RTCXS_PRESENCE_OFFLINE)
            {
                buddyTree.Nodes[0].Nodes.Add(buddyNode);
                buddyTree.Nodes[0].Expand();
            }
            else
            {
                buddyTree.Nodes[1].Nodes.Add(buddyNode);
                buddyTree.Nodes[1].Expand();
            }
            buddyHT.Add(buddy2, buddyNode);

            ArrayList deviceDisplayNameList = RTCHelp.BuildDeviceDisplayNameList(buddy2);
            foreach (string deviceDisplayName in deviceDisplayNameList )
            {
                TreeNode deviceNode = new TreeNode(deviceDisplayName);
                buddyNode.Nodes.Add(deviceNode);
            }

            buddyNode.Expand();
        }