예제 #1
0
        /// <summary>
        /// 可见状态改变方法
        /// </summary>
        public override void onVisibleChanged()
        {
            base.onVisibleChanged();
            FCNative native = Native;

            if (native != null)
            {
                if (Visible)
                {
                    if (m_frame == null)
                    {
                        m_frame = new FCWindowFrame();
                    }
                    native.removeControl(this);
                    native.addControl(m_frame);
                    m_frame.Size = native.DisplaySize;
                    if (!m_frame.containsControl(this))
                    {
                        m_frame.addControl(this);
                    }
                }
                else
                {
                    if (m_frame != null)
                    {
                        m_frame.removeControl(this);
                        native.removeControl(m_frame);
                    }
                }
            }
        }
예제 #2
0
        /// <summary>
        /// 读取XML
        /// </summary>
        /// <param name="node">XML节点</param>
        /// <param name="parent">父控件</param>
        public virtual FCView readNode(XmlNode node, FCView parent)
        {
            String type    = node.Name.ToLower();
            FCView control = createControl(node, type);

            if (control != null)
            {
                control.Native = m_native;
                if (parent != null)
                {
                    parent.addControl(control);
                }
                else
                {
                    m_native.addControl(control);
                }
                //前设置属性
                setAttributesBefore(node, control);
                if (control is FCSplitLayoutDiv)
                {
                    //创建分割层
                    createSplitLayoutSubProperty(node, control as FCSplitLayoutDiv);
                }
                else if (control is FCChart)
                {
                    createChartSubProperty(node, control as FCChart);
                }
                else if (control is FCTableLayoutDiv)
                {
                    createTableLayoutSubProperty(node, control as FCTableLayoutDiv);
                }
                else
                {
                    //加载子节点
                    readChildNodes(node, control);
                }
                //后设置属性
                setAttributesAfter(node, control);
                control.update();
                onAddControl(control, node);
            }
            else
            {
                //创建子属性
                createSubProperty(node, parent);
            }
            return(control);
        }