コード例 #1
0
        public bool AddBuddy(string strBuddyName)
        {
            try
            {
                int i = 0, tempBuddyCount = 0;
                for (i = 0; i < stPanel.Children.Count; i++)
                {
                    if (stPanel.Children[i].GetType() == typeof(ctlBuddy))
                    {
                        if (((ctlBuddy)stPanel.Children[i]).Title == strBuddyName)
                        {
                            break;
                        }
                        tempBuddyCount++;
                    }
                }
                if (tempBuddyCount == intBuddyCount)
                {
                    ctlBuddy objBuddy = new ctlBuddy();
                    objBuddy.Title = strBuddyName;
                    stPanel.Children.Add(objBuddy);
                    intBuddyCount++;

                    return(true);
                }
                return(false);
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "AddBuddy()", "Controls\\VMuktiGrid\\Buddy\\ctlPodBuddyList.xaml.cs");
                return(false);
            }
        }
コード例 #2
0
        public bool AddBuddy(string strBuddyName)
        {
            try
            {
                int i = 0, tempBuddyCount=0;
                for (i = 0; i < stPanel.Children.Count; i++)
                {
                    if (stPanel.Children[i].GetType() == typeof(ctlBuddy) )
                    {
                        if (((ctlBuddy)stPanel.Children[i]).Title == strBuddyName)
                        {
                            break;
                        }
                        tempBuddyCount++;
                    }
                }
                if (tempBuddyCount == intBuddyCount)
                {
                    ctlBuddy objBuddy = new ctlBuddy();
                    objBuddy.Title = strBuddyName;
                    stPanel.Children.Add(objBuddy);
                    intBuddyCount++;

                    return true;
                }
                return false;
            }
            catch (Exception ex)
            {
                VMuktiHelper.ExceptionHandler(ex, "AddBuddy()", "Controls\\VMuktiGrid\\Buddy\\ctlPodBuddyList.xaml.cs");                
                return false;
            }
        }