Example #1
0
        public static string GetValue(Mobile target, string propery)
        {
            if (!(target is Character))
            {
                return("");
            }

            GetPropertyEntry entry = (GetPropertyEntry)m_GetEntries[propery];

            if (entry != null)
            {
                if (entry.GetHandler != null)
                {
                    GetPropertyEventArgs e = new GetPropertyEventArgs(target, propery);
                    string str             = entry.GetHandler(e);
                    EventSink.InvokeGetProperty(e);
                    return(str);
                }
                else
                {
                    return("");
                }
            }
            else
            {
                return("");
            }
        }
Example #2
0
        public static AccessLevels GetAccessLevel(string property)
        {
            GetPropertyEntry entry = (GetPropertyEntry)m_GetEntries[property];

            if (entry != null)
            {
                return(entry.AccessLevel);
            }
            return(AccessLevels.PlayerLevel);
        }
Example #3
0
        public static bool HasProperty(string propery)
        {
            GetPropertyEntry entry = (GetPropertyEntry)m_GetEntries[propery];

            if (entry != null)
            {
                if (entry.GetHandler != null)
                {
                    return(true);
                }
            }
            return(false);
        }
Example #4
0
        public int CompareTo(object obj)
        {
            if (obj == this)
            {
                return(0);
            }
            else if (obj == null)
            {
                return(1);
            }

            GetPropertyEntry e = obj as GetPropertyEntry;

            if (e == null)
            {
                throw new ArgumentException();
            }

            return(m_Property.CompareTo(e.m_Property));
        }
Example #5
0
 public static void Register(string property, AccessLevels access, PropertyEventHandler handler, GetPropertyEventHandler gethandler)
 {
     m_Entries[property]    = new PropertyEntry(property, handler, access);
     m_GetEntries[property] = new GetPropertyEntry(property, gethandler, access);
 }