Пример #1
0
        internal DebugData GetDebugData()
        {
            DebugData result = new DebugData();

            foreach (string attribute in GetAttributeNames(true))
            {
                var attributeData = Get(attribute, true);
                var debugDataItem = new DebugDataItem(FormatDebugData(attributeData.Value));
                debugDataItem.Source      = attributeData.Source;
                debugDataItem.IsInherited = attributeData.IsInherited;

                result.Data.Add(attribute, debugDataItem);
            }

            return(result);
        }
Пример #2
0
        internal DebugData GetInheritedTypesDebugData()
        {
            DebugData result = new DebugData();

            // First we want all the types we include directly
            foreach (Element type in m_types)
            {
                if (!result.Data.ContainsKey(type.Name))
                {
                    DebugDataItem newItem = new DebugDataItem(type.Name);
                    newItem.Source        = m_element.Name;
                    newItem.IsDefaultType = WorldModel.DefaultTypeNames.ContainsValue(type.Name);
                    result.Data.Add(type.Name, newItem);
                }
                else
                {
                    // This element directly inherits a type which has also been included
                    // via inheriting another type

                    result.Data[type.Name].Source += "," + m_element.Name;
                }

                // Next we want all the types that are inherited from those, as attributes
                // from these will take priority over any other inherited types

                DebugData inheritedData = type.Fields.GetInheritedTypesDebugData();

                foreach (string typeName in inheritedData.Data.Keys)
                {
                    if (!result.Data.ContainsKey(typeName))
                    {
                        DebugDataItem item = inheritedData.Data[typeName];
                        item.IsInherited = true;
                        result.Data.Add(typeName, item);
                    }
                }
            }

            return(result);
        }
Пример #3
0
        private IEnumerable <IEditorAttributeData> ConvertDebugDataToEditorAttributeData(DebugData data)
        {
            List <EditorAttributeData> result = new List <EditorAttributeData>();

            foreach (var item in data.Data)
            {
                result.Add(new EditorAttributeData(item.Key, item.Value.IsInherited, item.Value.Source, item.Value.IsDefaultType));
            }
            return(result);
        }
Пример #4
0
 private IEnumerable<IEditorAttributeData> ConvertDebugDataToEditorAttributeData(DebugData data)
 {
     List<EditorAttributeData> result = new List<EditorAttributeData>();
     foreach (var item in data.Data)
     {
         result.Add(new EditorAttributeData(item.Key, item.Value.IsInherited, item.Value.Source, item.Value.IsDefaultType));
     }
     return result;
 }
Пример #5
0
        public IEnumerable <IEditorAttributeData> GetInheritedTypes()
        {
            DebugData data = m_controller.WorldModel.GetInheritedTypesDebugData(m_element.Name);

            return(ConvertDebugDataToEditorAttributeData(data));
        }