public void Apply()
        {
            Exception exception;

            try
            {
                int num;
                this.bool_1 = false;
                for (num = 0; num < this.ilist_0.Count; num++)
                {
                    this.itopology_0.RemoveClass(this.ilist_0[num] as IClass);
                }
                this.ilist_0.Clear();
                for (num = 0; num < this.gridView1.RowCount; num++)
                {
                    GridEditorItem row       = this.gridView1.GetRow(num) as GridEditorItem;
                    ITopologyClass topoClass = (row.Tag as Class6).TopoClass;
                    int            xYRank    = (int)row.Value;
                    try
                    {
                        if ((row.Tag as Class6).IsNew)
                        {
                            this.itopology_0.AddClass(topoClass as IClass, 1.0, xYRank, 1, false);
                            (row.Tag as Class6).IsNew = false;
                        }
                        else if (topoClass.XYRank != xYRank)
                        {
                            this.itopology_0.RemoveClass(topoClass as IClass);
                            int    zRank  = topoClass.ZRank;
                            double weight = topoClass.Weight;
                            bool   eventNotificationOnValidate = topoClass.EventNotificationOnValidate;
                            this.itopology_0.AddClass(topoClass as IClass, weight, xYRank, zRank,
                                                      eventNotificationOnValidate);
                        }
                    }
                    catch (Exception exception1)
                    {
                        exception = exception1;
                        Logger.Current.Error("", exception, "");
                    }
                }
            }
            catch (Exception exception2)
            {
                exception = exception2;
                Logger.Current.Error("", exception, "");
            }
        }
 private void TopologyClassesPropertyPage_Load(object sender, EventArgs e)
 {
     try
     {
         int num2;
         TopologyEditHelper.m_pList.RemoveAll();
         this.vertXtraGrid_0.EditorName  = "要素类";
         this.vertXtraGrid_0.EditorValue = "优先级";
         int num = 1;
         IEnumFeatureClass classes = (this.itopology_0 as IFeatureClassContainer).Classes;
         classes.Reset();
         ITopologyClass class3 = classes.Next() as ITopologyClass;
         IList          list   = new ArrayList();
         for (num2 = 1; num2 <= num; num2++)
         {
             list.Add(num2);
         }
         while (class3 != null)
         {
             if (class3.IsInTopology)
             {
                 num = (num < class3.XYRank) ? class3.XYRank : num;
                 this.vertXtraGrid_0.AddComBoBox((class3 as IDataset).Name, class3.XYRank, list, false,
                                                 new Class6(class3, false));
                 TopologyEditHelper.m_pList.Add(class3);
             }
             class3 = classes.Next() as ITopologyClass;
         }
         this.txtValue.Value = num;
         list.Clear();
         for (num2 = 1; num2 <= num; num2++)
         {
             list.Add(num2);
         }
         for (num2 = 0; num2 < this.gridView1.RowCount; num2++)
         {
             this.vertXtraGrid_0.ChangeItem(num2, ColumnAttribute.CA_COMBOBOX, list, 0.0, 0.0);
         }
     }
     catch (Exception exception)
     {
         Logger.Current.Error("", exception, "");
     }
     this.bool_0 = true;
 }
        private void btnAdd_Click(object sender, EventArgs e)
        {
            frmAddClass class2 = new frmAddClass
            {
                Topology = this.itopology_0
            };

            if (class2.ShowDialog() == DialogResult.OK)
            {
                try
                {
                    int   num2;
                    IList list  = class2.List;
                    int   num   = (int)this.txtValue.Value;
                    IList list2 = new ArrayList();
                    for (num2 = 1; num2 <= num; num2++)
                    {
                        list2.Add(num2);
                    }
                    for (num2 = 0; num2 < list.Count; num2++)
                    {
                        ITopologyClass class3 = list[num2] as ITopologyClass;
                        this.vertXtraGrid_0.AddComBoBox((class3 as IDataset).Name, 1, list2, false,
                                                        new Class6(class3, true));
                        TopologyEditHelper.m_pList.Add(class3);
                    }
                    this.bool_1 = true;
                    this.gridControl1.MainView.RefreshData();
                    if (this.OnValueChange != null)
                    {
                        this.OnValueChange();
                    }
                }
                catch (Exception exception)
                {
                    Logger.Current.Error("", exception, "");
                }
            }
        }
Beispiel #4
0
 public TopoClassWrap(ITopologyClass itopologyClass_1, bool bool_1)
 {
     this.itopologyClass_0 = itopologyClass_1;
     this.bool_0           = bool_1;
 }
 public Class6(ITopologyClass itopologyClass_1, bool bool_1)
 {
     this.itopologyClass_0 = itopologyClass_1;
     this.bool_0           = bool_1;
 }