Пример #1
0
 /// <summary>
 /// 设置属性
 /// </summary>
 /// <param name="name">属性名称</param>
 /// <param name="value">属性值</param>
 public override void setProperty(String name, String value)
 {
     if (name == "headersize")
     {
         if (m_headerButton != null)
         {
             m_headerButton.setProperty("size", value);
         }
     }
     else if (name == "headervisible")
     {
         HeaderVisible = FCStr.convertStrToBool(value);
     }
     else if (name.IndexOf("header-") != -1)
     {
         if (m_headerButton != null)
         {
             m_headerButton.setProperty(name.Substring(7), value);
         }
     }
     else
     {
         base.setProperty(name, value);
     }
 }
Пример #2
0
 /// <summary>
 /// 设置属性
 /// </summary>
 /// <param name="name">属性名称</param>
 /// <param name="value">属性值</param>
 public override void setProperty(String name, String value)
 {
     if (name == "candragsplitter")
     {
         if (m_splitter != null)
         {
             m_splitter.AllowDrag = FCStr.convertStrToBool(value);
         }
     }
     else if (name == "splitmode")
     {
         value = value.ToLower();
         if (value == "absolutesize")
         {
             SplitMode = FCSizeType.AbsoluteSize;
         }
         else
         {
             SplitMode = FCSizeType.PercentSize;
         }
     }
     else if (name.IndexOf("splitter-") != -1)
     {
         if (m_splitter != null)
         {
             m_splitter.setProperty(name.Substring(9), value);
         }
     }
     else if (name == "splitterposition")
     {
         if (m_splitter != null)
         {
             String[] strs = value.Split(new String[] { "," }, StringSplitOptions.RemoveEmptyEntries);
             if (strs.Length == 4)
             {
                 m_splitter.Bounds = FCStr.convertStrToRect(value);
             }
             else if (strs.Length <= 2)
             {
                 int pos    = FCStr.convertStrToInt(strs[0]);
                 int lWidth = 0;
                 if (strs.Length == 2)
                 {
                     lWidth = FCStr.convertStrToInt(strs[1]);
                 }
                 int width = Width, height = Height;
                 if (m_layoutStyle == FCLayoutStyle.TopToBottom || m_layoutStyle == FCLayoutStyle.BottomToTop)
                 {
                     m_splitter.Bounds = new FCRect(0, pos, width, pos + lWidth);
                 }
                 else
                 {
                     m_splitter.Bounds = new FCRect(pos, 0, pos + lWidth, height);
                 }
             }
         }
     }
     else if (name == "splittervisible")
     {
         if (m_splitter != null)
         {
             m_splitter.Visible = FCStr.convertStrToBool(value);
         }
     }
     else
     {
         base.setProperty(name, value);
     }
 }