Example #1
0
        public ValueDisplayHandler Find(Type type, ValueDisplayMode mode, string filter = null)
        {
            if (!m_TypesEvaluated)
            {
                ReEvaluateTypes();
            }
            if (filter == string.Empty)
            {
                filter = null;
            }

            int count = Records.Count;

            for (int i = 0; i < count; ++i)
            {
                DisplayHandleRecord record = Records[i];
                if (record.EvaluatedType == type && record.DisplayMode == mode && record.Filter == filter)
                {
                    return(record.Handler);
                }
            }
            return(null);
        }
Example #2
0
        public void ReEvaluateTypes()
        {
            int count = Records.Count;

            for (int i = 0; i < count; ++i)
            {
                DisplayHandleRecord record = Records[i];
                if (record.Filter == string.Empty)
                {
                    record.Filter = null;
                }

                if (!string.IsNullOrEmpty(record.TypeToDisplay))
                {
                    record.EvaluatedType = Type.GetType(record.TypeToDisplay, false);
                }
                else
                {
                    record.EvaluatedType = null;
                }
            }
            m_TypesEvaluated = true;
        }