123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- using System;
- using System.Collections.Generic;
- using System.ComponentModel;
- using System.Drawing;
- using System.Data;
- using System.Linq;
- using System.Text;
- using System.Windows.Forms;
- using Tofly.CoreUI.Win.Control;
- using Tofly.CoreUI.Control;
- using Tofly.Core.Components;
- namespace Tofly.SearchUI.Win
- {
-
-
-
- [Tofly.Core.Stereotype.Component(IsSingleton = "false", Name = "Tofly.SearchUI.Win.TFnumPluginControl")]
- public partial class TFnumPluginControl : UserControlClass, IParameterControl
- {
- public TFnumPluginControl()
- {
- InitializeComponent();
- this.combTFType.Properties.BeginUpdate();
- combTFType.Properties.Items.Clear();
- combTFType.Properties.Items.Add("选择图幅号");
- combTFType.Properties.Items.Add(10000);
- combTFType.Properties.Items.Add(25000);
- combTFType.Properties.Items.Add(50000);
- combTFType.Properties.Items.Add(100000);
- combTFType.Properties.Items.Add(250000);
- combTFType.Properties.Items.Add(500000);
- combTFType.Properties.Items.Add(1000000);
- combTFType.SelectedIndex = 0;
- }
- private ComponentBaseParameter componentParameter;
-
-
-
- public ComponentBaseParameter ComponentParameter
- {
- get
- {
- GetParameter();
- return componentParameter;
- }
- set
- {
- componentParameter = value;
- InitEdit();
- }
- }
-
-
-
- private void InitEdit()
- {
- if (componentParameter == null)
- return;
- Tofly.SearchUI.Command.CommandTFnumLocal.TFnumPluginParameter para = componentParameter as Tofly.SearchUI.Command.CommandTFnumLocal.TFnumPluginParameter;
- if (para == null)
- return;
- checkBox1.Checked=para.FixedScale ;
- combTFType.SelectedIndex=para.ScaleIndex ;
- if (para.Scales != null)
- {
- for (int i = 0; i < para.Scales.Count; i++)
- {
- textEdit1.Text += para.Scales[i] + ",";
- }
- if (textEdit1.Text.EndsWith(","))
- textEdit1.Text = textEdit1.Text.Substring(0, textEdit1.Text.Length - 1);
- }
- }
-
-
-
- private void GetParameter()
- {
- if(checkBox1.Checked && combTFType.SelectedIndex==0 )
- {
- Tofly.CoreUI.Message.MessageManager.Show("请选择图幅号!");
- return;
- }
- if (componentParameter == null)
- componentParameter = new Tofly.SearchUI.Command.CommandTFnumLocal.TFnumPluginParameter();
- Tofly.SearchUI.Command.CommandTFnumLocal.TFnumPluginParameter para = componentParameter as Tofly.SearchUI.Command.CommandTFnumLocal.TFnumPluginParameter;
- if (para == null)
- para = new Tofly.SearchUI.Command.CommandTFnumLocal.TFnumPluginParameter();
- para.FixedScale = checkBox1.Checked;
- para.ScaleIndex = combTFType.SelectedIndex;
- if (!String.IsNullOrEmpty(textEdit1.Text))
- {
- string[] tempvalues = textEdit1.Text.Split(',');
- for (int i = 0; i < tempvalues.Length; i++)
- para.Scales = new List<string>(tempvalues);
- }
- }
- }
- }
|