示例#1
0
        private void btnAddRule1_Click(object sender, EventArgs e)
        {
            frmAddRuleByClass class2 = new frmAddRuleByClass
            {
                OriginClassArray = this.iarray_1
            };

            if (class2.ShowDialog() == DialogResult.OK)
            {
                ITopologyRule[] topologyRules = class2.TopologyRules;
                if (topologyRules != null)
                {
                    for (int i = 0; i < topologyRules.Length; i++)
                    {
                        IFeatureClass class3;
                        ITopologyRule rule = topologyRules[i];
                        if (this.method_2(rule))
                        {
                            continue;
                        }
                        int index = 0;
                        while (index < this.iarray_0.Count)
                        {
                            class3 = (IFeatureClass)this.iarray_0.get_Element(index);
                            if (class3.ObjectClassID == rule.OriginClassID)
                            {
                                goto Label_0093;
                            }
                            index++;
                        }
                        goto Label_0106;
Label_0093:
                        this.listRule.Items.Add(class3.AliasName);
                        this.listRule.Items[this.listRule.Items.Count - 1].SubItems.Add(rule.Name);
                        this.listRule.Items[this.listRule.Items.Count - 1].Tag = rule;
Label_0106:
                        if (rule.OriginClassID != rule.DestinationClassID)
                        {
                            for (index = 0; index < this.iarray_0.Count; index++)
                            {
                                class3 = (IFeatureClass)this.iarray_0.get_Element(index);
                                if (class3.ObjectClassID == rule.DestinationClassID)
                                {
                                    goto Label_015C;
                                }
                            }
                        }
                        continue;
Label_015C:
                        this.listRule.Items[this.listRule.Items.Count - 1].SubItems.Add(class3.AliasName);
                    }
                }
            }
        }
        private void btnAddRule1_Click(object sender, EventArgs e)
        {
            frmAddRuleByClass class2 = new frmAddRuleByClass
            {
                OriginClassArray = TopologyEditHelper.m_pList
            };

            if (class2.ShowDialog() == DialogResult.OK)
            {
                ITopologyRule[] topologyRules = class2.TopologyRules;
                if (topologyRules != null)
                {
                    for (int i = 0; i < topologyRules.Length; i++)
                    {
                        ITopologyRule rule = topologyRules[i];
                        if (!this.method_2(rule))
                        {
                            string[] items = new string[3];
                            items[0] =
                                (this.itopology_0 as IFeatureClassContainer).get_ClassByID(rule.OriginClassID).AliasName;
                            items[1] = this.method_0(rule.TopologyRuleType);
                            if ((rule.OriginClassID != rule.DestinationClassID) && (rule.DestinationClassID > 0))
                            {
                                items[2] =
                                    (this.itopology_0 as IFeatureClassContainer).get_ClassByID(rule.DestinationClassID)
                                    .AliasName;
                            }
                            ListViewItem item = new ListViewItem(items)
                            {
                                Tag = new Class2(rule, true)
                            };
                            this.listView1.Items.Add(item);
                            this.bool_0 = true;
                            if (this.OnValueChange != null)
                            {
                                this.OnValueChange();
                            }
                        }
                    }
                }
            }
        }