RemoteMappingSettingControl.cs 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Drawing;
  5. using System.Data;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Windows.Forms;
  9. using Tofly.CoreUI.Control;
  10. using Tofly.CoreUI.Win.Control;
  11. using Tofly.Core.Components;
  12. using Tofly.GIS.SpatialReference;
  13. namespace Tofly.SearchUI.Win
  14. {
  15. /// <summary>
  16. ///
  17. /// </summary>
  18. [Tofly.Core.Stereotype.Component(IsSingleton = "false", Name = "Tofly.SearchUI.Win.RemoteMappingSettingControl")]
  19. public partial class RemoteMappingSettingControl : UserControlClass, IParameterControl
  20. {
  21. public RemoteMappingSettingControl()
  22. {
  23. InitializeComponent();
  24. }
  25. private ComponentBaseParameter componentParameter;
  26. /// <summary>
  27. /// 获取或设置当前的组件参数类
  28. /// </summary>
  29. public ComponentBaseParameter ComponentParameter
  30. {
  31. get
  32. {
  33. GetParameter();
  34. return componentParameter;
  35. }
  36. set
  37. {
  38. componentParameter = value;
  39. InitEdit();
  40. }
  41. }
  42. /// <summary>
  43. /// 初始化编辑
  44. /// </summary>
  45. private void InitEdit()
  46. {
  47. if (componentParameter == null)
  48. return;
  49. Tofly.SearchUI.Command.RemoteMappingSettingParameter para = componentParameter as Tofly.SearchUI.Command.RemoteMappingSettingParameter;
  50. if (para == null)
  51. componentParameter = null;
  52. else
  53. {
  54. this.txtBtnText.Text = para.buttonText;
  55. this.comboBox.Text = para.gridEdit;
  56. this.comboBox1.Text = para.maxEdit;
  57. this.textScales.Text = para.displayScales;
  58. }
  59. }
  60. /// <summary>
  61. /// 获取参数
  62. /// </summary>
  63. private void GetParameter()
  64. {
  65. if (componentParameter == null)
  66. componentParameter = new Tofly.SearchUI.Command.RemoteMappingSettingParameter();
  67. Tofly.SearchUI.Command.RemoteMappingSettingParameter remoteMappingSettingParameter = componentParameter as Tofly.SearchUI.Command.RemoteMappingSettingParameter;
  68. //设置按钮的标题
  69. remoteMappingSettingParameter.buttonText = this.txtBtnText.Text;
  70. remoteMappingSettingParameter.gridEdit = this.comboBox.Text;
  71. remoteMappingSettingParameter.maxEdit = this.comboBox1.Text;
  72. remoteMappingSettingParameter.displayScales = this.textScales.Text;
  73. }
  74. }
  75. }