All pastes #840428 Raw Edit

Something

public text v1 · immutable
#840428 ·published 2007-12-31 20:59 UTC
rendered paste body
        [Serializable]
        public struct key
        {
            public string value;

            public key(string s)
            {
                value = s;
            }

            public key(LLUUID u)
            {
                value = u.ToString();
            }

            static public implicit operator System.Boolean(key k)
            {
                if (k.value.Length == 0)
                {
                    return false;
                }
                if (k.value == "00000000-0000-0000-0000-000000000000")
                {
                    return false;
                }
                LLUUID tmp;
                if (LLUUID.TryParse(k.value, out tmp))
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }

            static public implicit operator key(string s)
            {
                return new key(s);
            }

            static public implicit operator System.String(key k)
            {
                return k.value;
            }

        }