private void method_1(string string_0, IHatchClass ihatchClass_0, TreeView treeView_0)
        {
            TreeNode node = new TreeNode(string_0)
            {
                Tag = ihatchClass_0
            };

            treeView_0.Nodes.Add(node);
            IEnumHatchDefinition enumHatchDefinitions = ihatchClass_0.HatchTemplate.EnumHatchDefinitions;

            enumHatchDefinitions.Reset();
            IHatchDefinition pHatchDefinition = null;
            int pHatchInterval = 0;

            enumHatchDefinitions.Next(ref pHatchInterval, ref pHatchDefinition);
            while (pHatchDefinition != null)
            {
                TreeNode node2 = new TreeNode("Hatch Def(" + pHatchInterval.ToString() + ")")
                {
                    Tag = new HatchDef(pHatchInterval, pHatchDefinition)
                };
                node.Nodes.Add(node2);
                enumHatchDefinitions.Next(ref pHatchInterval, ref pHatchDefinition);
            }
        }
        private void txtHatchInt_LostFocus(object sender, EventArgs e)
        {
            int multipleHatchInterval = int.Parse(this.txtHatchInt.Text);

            if (this.hatchDefinitionCtrl1.HatchInterval != multipleHatchInterval)
            {
                TreeNode             selectedNode         = this.treeView1.SelectedNode;
                IEnumHatchDefinition enumHatchDefinitions =
                    (selectedNode.Parent.Tag as IHatchClass).HatchTemplate.EnumHatchDefinitions;
                enumHatchDefinitions.Reset();
                IHatchDefinition pHatchDefinition = null;
                int pHatchInterval = 0;
                enumHatchDefinitions.Next(ref pHatchInterval, ref pHatchDefinition);
                int  index = 0;
                bool flag  = true;
                while (pHatchDefinition != null)
                {
                    if (multipleHatchInterval == this.hatchDefinitionCtrl1.HatchInterval)
                    {
                        if (MessageBox.Show("指定的刻度已存在,是否覆盖?", "刻度", MessageBoxButtons.YesNo) != DialogResult.Yes)
                        {
                            this.txtHatchInt.Text = this.hatchDefinitionCtrl1.HatchInterval.ToString();
                            return;
                        }
                        (selectedNode.Parent.Tag as IHatchClass).HatchTemplate.RemoveHatchDefinition(index);
                        (selectedNode.Parent.Tag as IHatchClass).HatchTemplate.AddHatchDefinition(
                            multipleHatchInterval, this.hatchDefinitionCtrl1.HatchDefinition);
                        flag = false;
                        break;
                    }
                    index++;
                    enumHatchDefinitions.Next(ref pHatchInterval, ref pHatchDefinition);
                }
                int num5 = 0;
                while (pHatchDefinition != null)
                {
                    if (pHatchInterval == this.hatchDefinitionCtrl1.HatchInterval)
                    {
                        (selectedNode.Parent.Tag as IHatchClass).HatchTemplate.RemoveHatchDefinition(index);
                        break;
                    }
                    num5++;
                    enumHatchDefinitions.Next(ref pHatchInterval, ref pHatchDefinition);
                }
                if (flag)
                {
                    (selectedNode.Parent.Tag as IHatchClass).HatchTemplate.AddHatchDefinition(multipleHatchInterval,
                                                                                              this.hatchDefinitionCtrl1.HatchDefinition);
                }
                TreeNode parent = selectedNode.Parent;
                this.method_2(selectedNode.Parent.Tag as IHatchClass, parent);
                this.treeView1.SelectedNode = parent;
            }
        }
 public HatchDef(int int_1, IHatchDefinition ihatchDefinition_1)
 {
     this.ihatchDefinition_0 = ihatchDefinition_1;
     this.int_0 = int_1;
 }
示例#4
0
 private void radioGroup1_SelectedIndexChanged(object sender, EventArgs e)
 {
     this.panel1.Visible = this.radioGroup1.SelectedIndex == 0;
     if (this.bool_0)
     {
         IHatchDefinition definition = null;
         if (this.radioGroup1.SelectedIndex == 0)
         {
             definition = new HatchLineDefinitionClass
             {
                 HatchSymbol = new SimpleLineSymbolClass()
             };
             try
             {
                 (definition as IHatchLineDefinition).Length = double.Parse(this.txtLength.Text);
             }
             catch
             {
             }
             if (this.ihatchDefinition_0 != null)
             {
                 definition.AdjustTextOrientation  = this.ihatchDefinition_0.AdjustTextOrientation;
                 definition.Alignment              = this.ihatchDefinition_0.Alignment;
                 definition.DisplayPrecision       = this.ihatchDefinition_0.DisplayPrecision;
                 definition.Expression             = this.ihatchDefinition_0.Expression;
                 definition.ExpressionParserEngine = this.ihatchDefinition_0.ExpressionParserEngine;
                 definition.ExpressionSimple       = this.ihatchDefinition_0.ExpressionSimple;
                 definition.Offset      = this.ihatchDefinition_0.Offset;
                 definition.Prefix      = this.ihatchDefinition_0.Prefix;
                 definition.ShowSign    = this.ihatchDefinition_0.ShowSign;
                 definition.Suffix      = this.ihatchDefinition_0.Suffix;
                 definition.TextDisplay = this.ihatchDefinition_0.TextDisplay;
                 definition.TextSymbol  = this.ihatchDefinition_0.TextSymbol;
             }
         }
         else
         {
             definition = new HatchMarkerDefinitionClass
             {
                 HatchSymbol = new SimpleMarkerSymbolClass()
             };
             if (this.ihatchDefinition_0 != null)
             {
                 definition.AdjustTextOrientation = this.ihatchDefinition_0.AdjustTextOrientation;
                 if (this.ihatchDefinition_0.Alignment == esriHatchAlignmentType.esriHatchAlignCenter)
                 {
                     definition.Alignment = esriHatchAlignmentType.esriHatchAlignLeft;
                 }
                 else
                 {
                     definition.Alignment = this.ihatchDefinition_0.Alignment;
                 }
                 definition.DisplayPrecision       = this.ihatchDefinition_0.DisplayPrecision;
                 definition.Expression             = this.ihatchDefinition_0.Expression;
                 definition.ExpressionParserEngine = this.ihatchDefinition_0.ExpressionParserEngine;
                 definition.ExpressionSimple       = this.ihatchDefinition_0.ExpressionSimple;
                 definition.Offset      = this.ihatchDefinition_0.Offset;
                 definition.Prefix      = this.ihatchDefinition_0.Prefix;
                 definition.ShowSign    = this.ihatchDefinition_0.ShowSign;
                 definition.Suffix      = this.ihatchDefinition_0.Suffix;
                 definition.TextDisplay = this.ihatchDefinition_0.TextDisplay;
                 definition.TextSymbol  = this.ihatchDefinition_0.TextSymbol;
             }
         }
         this.ihatchDefinition_0 = definition;
         if (this.ValueChanged != null)
         {
             this.ValueChanged(this, new EventArgs());
         }
         this.Init();
     }
 }