Beispiel #1
0
 //============================================================
 // <T>加载设置信息</T>
 //
 // @param xconfig 设置信息
 //============================================================
 public override void OnLoadConfig(FXmlNode xconfig)
 {
     base.OnLoadConfig(xconfig);
     // 加载配置
     _optionVisible = xconfig.GetBoolean("option_visible", _optionVisible);
     _optionEnable  = xconfig.GetBoolean("option_enable", _optionEnable);
     // 加载属性
     if (xconfig.Contains("dock_cd"))
     {
         _dockCd = (ERcDock)REnum.ToValue(typeof(ERcDock), xconfig.Get("dock_cd"));
     }
     // 加载位置
     if (xconfig.Contains("location"))
     {
         _location.Parse(xconfig.Get("location"));
     }
     // 加载尺寸
     if (xconfig.Contains("size"))
     {
         _size.Parse(xconfig.Get("size"));
     }
     // 加载空白
     if (xconfig.Contains("margin"))
     {
         _margin.Parse(xconfig.Get("margin"));
     }
     if (xconfig.Contains("padding"))
     {
         _padding.Parse(xconfig.Get("padding"));
     }
     // 加载边框
     _borderInner.LoadConfig(xconfig, "border_inner");
     _borderOuter.LoadConfig(xconfig, "border_outer");
     // 加载前景
     _foreColor = xconfig.GetHex("fore_color", _foreColor);
     _foreResource.LoadConfig(xconfig, "fore");
     // 加载后景
     _backColor = xconfig.GetHex("back_color", _backColor);
     _backResource.LoadConfig(xconfig, "back");
     // 加载事件
     _onClick       = xconfig.Get("on_click", null);
     _onDoubleClick = xconfig.Get("on_double_click", null);
     _onMouseDown   = xconfig.Get("on_mouse_down", null);
     _onMouseUp     = xconfig.Get("on_mouse_up", null);
     _onMouseEnter  = xconfig.Get("on_mouse_enter", null);
     _onMouseMove   = xconfig.Get("on_mouse_move", null);
     _onMouseLeave  = xconfig.Get("on_mouse_leave", null);
 }