You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
159 lines
4.3 KiB
159 lines
4.3 KiB
using System; |
|
using System.Collections.Generic; |
|
using System.ComponentModel; |
|
using System.Drawing; |
|
using System.Windows.Forms; |
|
using Kingo.Mobile.Shape2KOTool.XSDClass; |
|
|
|
namespace Kingo.Mobile.Shape2KOTool |
|
{ |
|
// Token: 0x0200004C RID: 76 |
|
public partial class frmLabelInfoSetting : Form |
|
{ |
|
// Token: 0x06000281 RID: 641 RVA: 0x0000F338 File Offset: 0x0000D538 |
|
public frmLabelInfoSetting(List<ShapeFieldInfo> fields) |
|
{ |
|
this.InitializeComponent(); |
|
this.comboBoxMainFileds.DataSource = fields; |
|
this.comboBoxMainFileds.DisplayMember = "FieldAlias"; |
|
this.comboBoxMainFileds.ValueMember = "FieldName"; |
|
} |
|
|
|
// Token: 0x06000282 RID: 642 RVA: 0x0000F38B File Offset: 0x0000D58B |
|
private void frmLabelInfoSetting_Load(object sender, EventArgs e) |
|
{ |
|
} |
|
|
|
// Token: 0x06000283 RID: 643 RVA: 0x0000F390 File Offset: 0x0000D590 |
|
public LabelingInfo GetLabelInfo() |
|
{ |
|
LabelingInfo result; |
|
if (!this.cboxShowLabel.Checked) |
|
{ |
|
result = null; |
|
} |
|
else |
|
{ |
|
result = CommonMethod.GetLabelInfo(this.lbFontAndSize.Font, this.lbFontAndSize.ForeColor, this.comboBoxMainFileds.SelectedValue.ToString(), Convert.ToInt32(this.cboxMinScale.Text), Convert.ToInt32(this.cboxMaxScale.Text)); |
|
} |
|
return result; |
|
} |
|
|
|
// Token: 0x06000284 RID: 644 RVA: 0x0000F400 File Offset: 0x0000D600 |
|
public void SetLabelInfo(LabelingInfo labelInfo) |
|
{ |
|
this.cboxShowLabel.Checked = (labelInfo != null); |
|
if (labelInfo != null) |
|
{ |
|
this.cboxMaxScale.Text = labelInfo.MaxScale.ToString(); |
|
this.cboxMinScale.Text = labelInfo.MinScale.ToString(); |
|
if (!string.IsNullOrEmpty(labelInfo.LabelExpression)) |
|
{ |
|
this.comboBoxMainFileds.SelectedValue = labelInfo.LabelExpression.Replace("[", "").Replace("]", ""); |
|
} |
|
if (labelInfo.Symbol != null) |
|
{ |
|
if (labelInfo.Symbol.Font != null) |
|
{ |
|
this.lbFontAndSize.Font = new Font(labelInfo.Symbol.Font.Family, (float)labelInfo.Symbol.Font.Size, ((labelInfo.Symbol.Font.Decoration == "underline") ? FontStyle.Underline : FontStyle.Regular) | ((labelInfo.Symbol.Font.Weight == "bold") ? FontStyle.Bold : FontStyle.Regular)); |
|
} |
|
if (labelInfo.Symbol.Color != null) |
|
{ |
|
this.lbFontAndSize.ForeColor = CommonMethod.GetColorFromInt4Color(labelInfo.Symbol.Color); |
|
} |
|
} |
|
} |
|
} |
|
|
|
// Token: 0x06000285 RID: 645 RVA: 0x0000F570 File Offset: 0x0000D770 |
|
private void btnFont_Click(object sender, EventArgs e) |
|
{ |
|
this.fontDialog1.Font = this.lbFontAndSize.Font; |
|
if (this.fontDialog1.ShowDialog(this) == DialogResult.OK) |
|
{ |
|
this.lbFontAndSize.Font = this.fontDialog1.Font; |
|
} |
|
} |
|
|
|
// Token: 0x06000286 RID: 646 RVA: 0x0000F5C4 File Offset: 0x0000D7C4 |
|
private void btnColor_Click(object sender, EventArgs e) |
|
{ |
|
this.colorDialog1.Color = this.lbFontAndSize.ForeColor; |
|
if (this.colorDialog1.ShowDialog(this) == DialogResult.OK) |
|
{ |
|
this.lbFontAndSize.ForeColor = this.colorDialog1.Color; |
|
} |
|
} |
|
|
|
// Token: 0x06000287 RID: 647 RVA: 0x0000F618 File Offset: 0x0000D818 |
|
private void btnOk_Click(object sender, EventArgs e) |
|
{ |
|
try |
|
{ |
|
this.CheckBLC(); |
|
} |
|
catch (Exception ex) |
|
{ |
|
MessageBox.Show(ex.Message); |
|
return; |
|
} |
|
base.DialogResult = DialogResult.OK; |
|
base.Close(); |
|
} |
|
|
|
// Token: 0x06000288 RID: 648 RVA: 0x0000F664 File Offset: 0x0000D864 |
|
private void cboxShowLabel_CheckedChanged(object sender, EventArgs e) |
|
{ |
|
this.panel1.Enabled = this.cboxShowLabel.Checked; |
|
} |
|
|
|
// Token: 0x06000289 RID: 649 RVA: 0x0000F680 File Offset: 0x0000D880 |
|
private void cboxMaxScale_TextChanged(object sender, EventArgs e) |
|
{ |
|
try |
|
{ |
|
this.CheckBLC(); |
|
} |
|
catch (Exception ex) |
|
{ |
|
MessageBox.Show(ex.Message); |
|
} |
|
} |
|
|
|
// Token: 0x0600028A RID: 650 RVA: 0x0000F6BC File Offset: 0x0000D8BC |
|
private bool CheckBLC() |
|
{ |
|
int num = 0; |
|
int num2 = 0; |
|
try |
|
{ |
|
num = Convert.ToInt32(this.cboxMaxScale.Text); |
|
if (num < 0) |
|
{ |
|
throw new Exception("请输入正整数"); |
|
} |
|
} |
|
catch |
|
{ |
|
throw new Exception("请输入整数"); |
|
} |
|
try |
|
{ |
|
num2 = Convert.ToInt32(this.cboxMinScale.Text); |
|
if (num2 < 0) |
|
{ |
|
throw new Exception("请输入正整数"); |
|
} |
|
} |
|
catch |
|
{ |
|
throw new Exception("请输入整数"); |
|
} |
|
if (num > num2) |
|
{ |
|
throw new Exception("最大可见比例尺应该大于最小可见比例尺"); |
|
} |
|
return true; |
|
} |
|
} |
|
}
|
|
|