コード例 #1
0
 public void ChangeVersion(IMap imap_0, IFeatureWorkspace ifeatureWorkspace_0,
                           IFeatureWorkspace ifeatureWorkspace_1)
 {
     try
     {
         if ((((imap_0 != null) && (ifeatureWorkspace_0 != null)) && (ifeatureWorkspace_1 != null)) &&
             !this.method_6(ifeatureWorkspace_0))
         {
             ICollectionTableVersionChanges changes = new EnumTableVersionChangesClass();
             (ifeatureWorkspace_1 as IVersion).RefreshVersion();
             imap_0.ClearSelection();
             IMapAdmin2 admin = imap_0 as IMapAdmin2;
             admin.FireChangeVersion(ifeatureWorkspace_0 as IVersion, ifeatureWorkspace_1 as IVersion);
             this.method_5(imap_0, ifeatureWorkspace_0, ifeatureWorkspace_1, changes);
             this.method_4(imap_0 as IStandaloneTableCollection, ifeatureWorkspace_0, ifeatureWorkspace_1,
                           changes);
             this.method_0(admin, changes as IEnumTableVersionChanges);
             changes.RemoveAll();
             (imap_0 as IActiveView).Refresh();
         }
     }
     catch
     {
     }
 }
コード例 #2
0
 public void ChangeVersion(IGraphicsContainer igraphicsContainer_0, IFeatureWorkspace ifeatureWorkspace_0,
                           IFeatureWorkspace ifeatureWorkspace_1)
 {
     try
     {
         if (((igraphicsContainer_0 != null) && (ifeatureWorkspace_0 != null)) && (ifeatureWorkspace_1 != null))
         {
             if (this.method_6(ifeatureWorkspace_0))
             {
                 MessageBox.Show("当前版本在编辑状态,不能改变版本!");
             }
             else
             {
                 IMap       map;
                 IMapAdmin2 admin;
                 ICollectionTableVersionChanges changes = new EnumTableVersionChangesClass();
                 try
                 {
                     (ifeatureWorkspace_1 as IVersion).RefreshVersion();
                 }
                 catch (Exception exception1)
                 {
                     exception1.ToString();
                 }
                 if (igraphicsContainer_0 is IMap)
                 {
                     map = igraphicsContainer_0 as IMap;
                     map.ClearSelection();
                     admin = map as IMapAdmin2;
                     admin.FireChangeVersion(ifeatureWorkspace_0 as IVersion, ifeatureWorkspace_1 as IVersion);
                     this.method_5(map, ifeatureWorkspace_0, ifeatureWorkspace_1, changes);
                     this.method_4(map as IStandaloneTableCollection, ifeatureWorkspace_0, ifeatureWorkspace_1,
                                   changes);
                     this.method_0(admin, changes as IEnumTableVersionChanges);
                     changes.RemoveAll();
                     (map as IActiveView).Refresh();
                 }
                 else
                 {
                     igraphicsContainer_0.Reset();
                     for (IElement element = igraphicsContainer_0.Next();
                          element != null;
                          element = igraphicsContainer_0.Next())
                     {
                         if (element is IMapFrame)
                         {
                             map = (element as IMapFrame).Map;
                             map.ClearSelection();
                             admin = map as IMapAdmin2;
                             admin.FireChangeVersion(ifeatureWorkspace_0 as IVersion,
                                                     ifeatureWorkspace_1 as IVersion);
                             this.method_5(map, ifeatureWorkspace_0, ifeatureWorkspace_1, changes);
                             this.method_4(map as IStandaloneTableCollection, ifeatureWorkspace_0,
                                           ifeatureWorkspace_1, changes);
                             this.method_0(admin, changes as IEnumTableVersionChanges);
                             changes.RemoveAll();
                             (map as IActiveView).Refresh();
                         }
                     }
                 }
             }
         }
     }
     catch (Exception exception2)
     {
         exception2.ToString();
     }
 }