private void chkLabel_CheckedChanged(object sender, EventArgs e) { if (this.bool_0) { this.iannotateLayerProperties_0.DisplayAnnotation = this.chkLabel.Checked; this.bool_3 = true; AnnotateLayerPropertiesWrap selectedItem = this.cboClass.SelectedItem as AnnotateLayerPropertiesWrap; selectedItem.Update = true; } }
private void btnAddClass_Click(object sender, EventArgs e) { frmInput input = new frmInput("类名称:", ""); if (input.ShowDialog() == DialogResult.OK) { if (input.InputValue.Trim().Length == 0) { MessageBox.Show("非法类名!"); } else { for (int i = 0; i < this.cboClass.Properties.Items.Count; i++) { AnnotateLayerPropertiesWrap wrap = this.cboClass.Properties.Items[i] as AnnotateLayerPropertiesWrap; if (wrap.AnnotateLayerProperties.Class == input.InputValue) { MessageBox.Show("类名必须唯一!"); return; } } IAnnotateLayerProperties properties = new LabelEngineLayerPropertiesClass { Class = input.InputValue, FeatureLinked = this.iannotateLayerProperties_0.FeatureLinked, FeatureLayer = this.iannotateLayerProperties_0.FeatureLayer, AddUnplacedToGraphicsContainer = this.iannotateLayerProperties_0.AddUnplacedToGraphicsContainer, AnnotationMaximumScale = this.iannotateLayerProperties_0.AnnotationMaximumScale, AnnotationMinimumScale = this.iannotateLayerProperties_0.AnnotationMinimumScale, CreateUnplacedElements = this.iannotateLayerProperties_0.CreateUnplacedElements, DisplayAnnotation = this.iannotateLayerProperties_0.DisplayAnnotation, LabelWhichFeatures = this.iannotateLayerProperties_0.LabelWhichFeatures, Priority = this.iannotateLayerProperties_0.Priority, UseOutput = this.iannotateLayerProperties_0.UseOutput, WhereClause = this.iannotateLayerProperties_0.WhereClause }; ILabelEngineLayerProperties properties2 = properties as ILabelEngineLayerProperties; ILabelEngineLayerProperties properties3 = this.iannotateLayerProperties_0 as ILabelEngineLayerProperties; properties2.Expression = properties3.Expression; properties2.IsExpressionSimple = properties3.IsExpressionSimple; int num2 = this.method_2(); properties2.SymbolID = num2; properties2.Symbol = (properties3.Symbol as IClone).Clone() as ITextSymbol; this.cboClass.Properties.Items.Add(new AnnotateLayerPropertiesWrap(properties, num2, true)); this.bool_3 = true; } } }
private void btnScaleSet_Click(object sender, EventArgs e) { frmAnnoScaleSet set = new frmAnnoScaleSet { AnnotateLayerProperties = this.iannotateLayerProperties_0 }; if (set.ShowDialog() == DialogResult.OK) { AnnotateLayerPropertiesWrap selectedItem = this.cboClass.SelectedItem as AnnotateLayerPropertiesWrap; selectedItem.Update = true; this.bool_3 = true; } }
private void btnDeleteClass_Click(object sender, EventArgs e) { if (this.cboClass.SelectedIndex != -1) { AnnotateLayerPropertiesWrap selectedItem = this.cboClass.SelectedItem as AnnotateLayerPropertiesWrap; if (!selectedItem.IsNew) { this.ilist_0.Add(selectedItem); this.bool_3 = true; } this.cboClass.Properties.Items.RemoveAt(this.cboClass.SelectedIndex); this.cboClass.SelectedIndex = 0; } }
private void btnEditSymbol_Click(object sender, EventArgs e) { frmTextSymbolEdit edit = new frmTextSymbolEdit(); edit.SetSymbol(this.itextSymbol_0 as ISymbol); if (edit.ShowDialog() == DialogResult.OK) { this.itextSymbol_0 = edit.GetSymbol() as ITextSymbol; this.symbolItem.Symbol = this.itextSymbol_0; (this.iannotateLayerProperties_0 as ILabelEngineLayerProperties).Symbol = this.itextSymbol_0; this.bool_3 = true; AnnotateLayerPropertiesWrap selectedItem = this.cboClass.SelectedItem as AnnotateLayerPropertiesWrap; selectedItem.Update = true; } }
private void simpleButton1_Click(object sender, EventArgs e) { frmExpressionSet set = new frmExpressionSet { LabelExpression = this.string_0, AnnotationExpressionEngine = this.iannotationExpressionEngine_0, IsExpressionSimple = this.bool_1, GeoFeatureLayer = this.igeoFeatureLayer_0 }; if (set.ShowDialog() == DialogResult.OK) { this.string_0 = set.LabelExpression; this.iannotationExpressionEngine_0 = set.AnnotationExpressionEngine; this.bool_1 = set.IsExpressionSimple; (this.iannotateLayerProperties_0 as ILabelEngineLayerProperties).Expression = this.string_0; (this.iannotateLayerProperties_0 as ILabelEngineLayerProperties).ExpressionParser = this.iannotationExpressionEngine_0; (this.iannotateLayerProperties_0 as ILabelEngineLayerProperties).IsExpressionSimple = this.bool_1; this.bool_3 = true; AnnotateLayerPropertiesWrap selectedItem = this.cboClass.SelectedItem as AnnotateLayerPropertiesWrap; selectedItem.Update = true; int index = this.string_0.IndexOf("[", 1); IFields fields = this.igeoFeatureLayer_0.FeatureClass.Fields; this.bool_0 = false; if (index != -1) { this.cboFields.Enabled = false; this.cboFields.Text = "表达式"; } else { string name = this.string_0.Substring(1, this.string_0.Length - 2).Trim(); index = fields.FindField(name); if (index == -1) { this.cboFields.Enabled = false; this.cboFields.Text = "表达式"; } else { this.cboFields.Enabled = true; this.cboFields.Text = fields.get_Field(index).AliasName; } } this.bool_0 = true; } }
private void btnSQL_Click(object sender, EventArgs e) { frmAttributeQueryBuilder builder = new frmAttributeQueryBuilder { Table = this.igeoFeatureLayer_0.FeatureClass as ITable, WhereCaluse = this.iannotateLayerProperties_0.WhereClause }; if (builder.ShowDialog() == DialogResult.OK) { this.iannotateLayerProperties_0.WhereClause = builder.WhereCaluse; this.bool_3 = true; AnnotateLayerPropertiesWrap selectedItem = this.cboClass.SelectedItem as AnnotateLayerPropertiesWrap; selectedItem.Update = true; } }
private int method_2() { IList list = new ArrayList(); for (int i = 0; i < this.cboClass.Properties.Items.Count; i++) { AnnotateLayerPropertiesWrap wrap = this.cboClass.Properties.Items[i] as AnnotateLayerPropertiesWrap; list.Add(wrap.ID); } int num2 = 0; while (list.IndexOf(num2) != -1) { num2++; } return(num2); }
private void cboFields_SelectedIndexChanged(object sender, EventArgs e) { if (this.bool_0) { this.bool_3 = true; IFields fields = this.igeoFeatureLayer_0.FeatureClass.Fields; int index = fields.FindFieldByAliasName(this.cboFields.Text); if (index != -1) { IField field = fields.get_Field(index); this.string_0 = "[" + field.Name + "]"; (this.iannotateLayerProperties_0 as ILabelEngineLayerProperties).Expression = this.string_0; AnnotateLayerPropertiesWrap selectedItem = this.cboClass.SelectedItem as AnnotateLayerPropertiesWrap; selectedItem.Update = true; } } }