예제 #1
0
파일: EditorTab.cs 프로젝트: Pertex/Quest
        public EditorTab(EditorDefinition parent, WorldModel worldModel, Element source)
        {
            m_controls = new Dictionary<string, IEditorControl>();
            m_caption = source.Fields.GetString("caption");

            foreach (Element e in worldModel.Elements.GetElements(ElementType.EditorControl))
            {
                if (e.Parent == source)
                {
                    m_controls.Add(e.Name, new EditorControl(parent, worldModel, e));
                }
            }
            m_visibilityHelper = new EditorVisibilityHelper(parent, worldModel, source);
        }
예제 #2
0
        public EditorControl(EditorDefinition parent, WorldModel worldModel, Element source)
        {
            m_parent = parent;
            m_worldModel = worldModel;
            m_source = source;
            m_controlType = source.Fields.GetString("controltype");
            m_caption = source.Fields.GetString("caption");
            m_attribute = source.Fields.GetString("attribute");
            if (source.Fields.HasType<int>("height")) m_height = source.Fields.GetAsType<int>("height");
            if (source.Fields.HasType<int>("width")) m_width = source.Fields.GetAsType<int>("width");
            if (source.Fields.HasType<bool>("expand")) m_expand = source.Fields.GetAsType<bool>("expand");
            m_visibilityHelper = new EditorVisibilityHelper(parent, worldModel, source);

            if (source.Fields.HasString("filtergroup"))
            {
                parent.RegisterFilter(source.Fields.GetString("filtergroup"), source.Fields.GetString("filter"), m_attribute);
            }
        }