Beispiel #1
0
 //============================================================
 // <T>存储设置信息</T>
 //
 // @param xconfig 设置信息
 //============================================================
 public override void OnSaveConfig(FXmlNode xconfig)
 {
     base.OnSaveConfig(xconfig);
     // 存储配置
     xconfig.SetNvl("option_visible", _optionVisible);
     xconfig.SetNvl("option_enable", _optionEnable);
     // 保存属性
     if (_dockCd != ERcDock.None)
     {
         xconfig.SetNvl("dock_cd", REnum.ToString(typeof(ERcDock), _dockCd));
     }
     // 存储位置
     if (!_location.IsEmpty())
     {
         xconfig.Set("location", _location.ToString());
     }
     // 存储尺寸
     if (!_size.IsEmpty())
     {
         xconfig.SetNvl("size", _size.ToString());
     }
     // 加载空白
     if (!_margin.IsEmpty())
     {
         xconfig.SetNvl("margin", _margin.ToString());
     }
     if (!_padding.IsEmpty())
     {
         xconfig.SetNvl("padding", _padding.ToString());
     }
     // 存储边框
     if (_propertyBorderInner == null || (_propertyBorderInner != null && !_borderInner.EqualsStyleProperty(_propertyBorderInner)))
     {
         _borderInner.SaveConfig(xconfig, "border_inner");
     }
     if (_propertyBorderOuter == null || (_propertyBorderOuter != null && !_borderOuter.EqualsStyleProperty(_propertyBorderOuter)))
     {
         _borderOuter.SaveConfig(xconfig, "border_outer");
     }
     // 保存前景资源
     if ((_propertyForeColor == null) || (_propertyForeColor != null && _foreColor != _propertyForeColor.GetHex()))
     {
         xconfig.Set("fore_color", RColor.FormatHtml(_foreColor));
     }
     _foreResource.SaveConfig(xconfig, "fore");
     // 保存后景资源
     if ((_propertyBackColor == null) || (_propertyBackColor != null && _backColor != _propertyBackColor.GetHex()))
     {
         xconfig.Set("back_color", RColor.FormatHtml(_backColor));
     }
     _backResource.SaveConfig(xconfig, "back");
     // 存储事件
     xconfig.SetNvl("on_click", _onClick);
     xconfig.SetNvl("on_double_click", _onDoubleClick);
     xconfig.SetNvl("on_mouse_down", _onMouseDown);
     xconfig.SetNvl("on_mouse_up", _onMouseUp);
     xconfig.SetNvl("on_mouse_enter", _onMouseEnter);
     xconfig.SetNvl("on_mouse_move", _onMouseMove);
     xconfig.SetNvl("on_mouse_leave", _onMouseLeave);
 }