Example #1
0
        // Exceptions:
        //	System.ArgumentException:
        //		Other object is null
        //		The argument to compare is not a UserNameImageList
        //		Refering object (this) is null
        public override int CompareTo(object other)
        {
            if (other == null)
            {
                throw new System.ArgumentException("Other object is null", "other");
            }

            UserNameImageList userNameImageList = other as UserNameImageList;

            if (userNameImageList == null)
            {
                throw new System.ArgumentException("The argument to compare is not a UserNameImageList", "other");
            }

            if (IsNull)// || (!IsLoaded()))
            {
                throw new System.ArgumentException("Refering object (this) is null", "this");
            }

            return(this.ToString().CompareTo(userNameImageList.ToString()));
        }
Example #2
0
        public static UserNameImageList Parse(string str)
        {
            int strCnt = 0;
            int count  = 0;

            UserNameImageList userNameImageList = new UserNameImageList();

            string[] strSplit = null;
            strSplit = str.Split(new char[] { ';' });

            userNameImageList.UniqueID = Convert.ToUInt64(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;

            count = Convert.ToInt32(strSplit[strCnt] == null ? "0" : strSplit[strCnt]); strCnt++;
            for (int i = 0; i < count; i++)
            {
                if (strSplit[strCnt] == null)
                {
                    break;
                }
                userNameImageList.Items.Add(new NameImage(strSplit[strCnt], strSplit[strCnt + 1])); strCnt++; strCnt++;
            }

            return(userNameImageList);
        }