private void btnSelectGDB_Click(object sender, EventArgs e) { frmOpenFile file = new frmOpenFile(); file.AddFilter(new MyGxFilterWorkspaces(), true); if (file.ShowDialog() == DialogResult.OK) { IGxDatabase database = file.Items.get_Element(0) as IGxDatabase; if (database != null) { this.txtGDB.Text = (database as IGxObject).FullName; if (!database.IsConnected) { database.Connect(); } IWorkspaceReplicas workspace = database.Workspace as IWorkspaceReplicas; if (workspace != null) { IEnumReplica replicas = workspace.Replicas; replicas.Reset(); IReplica replica2 = replicas.Next(); if (replica2 != null) { this.lblCheckOutName.Text = replica2.Name; this.txtGDB.Tag = database.WorkspaceName; } else { this.txtGDB.Tag = null; } } } } }
public void Init() { if (CheckInHelper.m_pHelper.MasterWorkspaceName != null) { this.panel_by_MasterGDB.Visible = true; this.panelbycheckoutdb.Visible = false; this.lblCheckInGDB.Text = this.method_0(CheckInHelper.m_pHelper.MasterWorkspaceName); this.radioGroup1_SelectedIndexChanged(this, new EventArgs()); } else { this.panel_by_MasterGDB.Visible = false; this.panelbycheckoutdb.Visible = true; IWorkspace workspace = (CheckInHelper.m_pHelper.CheckoutWorkspaceName as IName).Open() as IWorkspace; IWorkspaceReplicas replicas = workspace as IWorkspaceReplicas; IEnumReplica replica = replicas.Replicas; replica.Reset(); IReplica replica2 = replica.Next(); if (replica2 != null) { this.lblCheckOutName1.Text = replica2.Name; this.lblMasterGDB2.Text = this.method_0(replica2.ConnectionInfo); this.lblMasterGDB2.Tag = replica2.ConnectionInfo; this.lblCheckInGDB2.Text = this.method_0(CheckInHelper.m_pHelper.CheckoutWorkspaceName); } } }
private void method_11() { esriExportDataChangesOption esriExportToAccess = esriExportDataChangesOption.esriExportToAccess; if (Path.GetExtension(this.string_0).ToLower() == ".xml") { esriExportToAccess = esriExportDataChangesOption.esriExportToXML; } IExportDataChanges changes = new DataChangesExporterClass(); IName name = this.iworkspaceName_0 as IName; IWorkspace workspace = name.Open() as IWorkspace; IWorkspaceReplicas replicas = workspace as IWorkspaceReplicas; IEnumReplica replica = replicas.Replicas; replica.Reset(); if (replica != null) { for (IReplica replica2 = replica.Next(); replica2 != null; replica2 = replica.Next()) { if (replica2.ReplicaRole == esriReplicaType.esriCheckOutTypeChild) { IReplicaDataChangesInit init = new CheckOutDataChangesClass(); init.Init(replica2, this.iworkspaceName_0); IDataChanges dataChanges = init as IDataChanges; changes.ExportDataChanges(this.string_0, esriExportToAccess, dataChanges, true); } } } }
private void method_12(IArray iarray_1, ICompositeLayer icompositeLayer_0) { for (int i = 0; i < icompositeLayer_0.Count; i++) { ILayer layer = icompositeLayer_0.get_Layer(i); if (layer is IGroupLayer) { this.method_12(iarray_1, layer as ICompositeLayer); } else if (layer is IFeatureLayer) { IFeatureLayer layer2 = layer as IFeatureLayer; IDataset featureClass = layer2.FeatureClass as IDataset; if ((featureClass != null) && !(featureClass is ICoverageFeatureClass)) { IWorkspace workspace = featureClass.Workspace; if (workspace is IWorkspaceReplicas) { IEnumReplica replicas = (workspace as IWorkspaceReplicas).Replicas; replicas.Reset(); if (replicas.Next() != null) { (this.method_14(this.iarray_0, workspace).EnumName as IEnumNameEdit).Add( featureClass.FullName); } } } } } }
private bool method_2(IWorkspace iworkspace_0, IEnumName ienumName_0) { if (iworkspace_0 is IWorkspaceReplicas) { IEnumReplica replicas = (iworkspace_0 as IWorkspaceReplicas).Replicas; replicas.Reset(); if (replicas.Next() != null) { MessageBox.Show("检出数据库中包含一个有效的检出。"); return(false); } ienumName_0.Reset(); for (IDatasetName name = ienumName_0.Next() as IDatasetName; name != null; name = ienumName_0.Next() as IDatasetName) { if (this.method_1(iworkspace_0, name.Type, this.method_0(name).ToLower())) { if (this.chkResueSchema.Checked) { return(true); } MessageBox.Show("选择的检出空间数据库中有同名的要素集,如果要用该检出空间数据库,请在重用选项上打勾。"); return(false); } } } return(true); }
private void ExportChangeSetupCtrl_Load(object sender, EventArgs e) { this.lblCheckOutGDB.Text = this.method_0(ExportChangesHelper.m_pHelper.CheckoutWorkspaceName); IWorkspace workspace = (ExportChangesHelper.m_pHelper.CheckoutWorkspaceName as IName).Open() as IWorkspace; IWorkspaceReplicas replicas = workspace as IWorkspaceReplicas; IEnumReplica replica = replicas.Replicas; replica.Reset(); IReplica replica2 = replica.Next(); if (replica2 != null) { this.lblCheckOutName.Text = replica2.Name; } }
private void frmCheckOutManager_Load(object sender, EventArgs e) { if (this.iarray_0.Count == 1) { CheckInOutWorkspaceInfo info = this.iarray_0.get_Element(0) as CheckInOutWorkspaceInfo; this.iworkspace_0 = info.Workspace; } else { if (this.iarray_0.Count <= 0) { return; } frmSelectWorkspace workspace = new frmSelectWorkspace { WorkspaceArray = this.iarray_0 }; if (workspace.ShowDialog() != DialogResult.OK) { base.Close(); return; } this.iworkspace_0 = workspace.Workspace; } IWorkspaceReplicas replicas = this.iworkspace_0 as IWorkspaceReplicas; IEnumReplica replica = replicas.Replicas; replica.Reset(); IReplica replica2 = replica.Next(); string[] items = new string[4]; while (replica2 != null) { items[0] = replica2.Name; items[1] = replica2.Owner; items[2] = replica2.Version; items[3] = new DateTime((long)replica2.ReplicaDate).ToString(); ListViewItem item = new ListViewItem(items) { Tag = replica2 }; this.listView1.Items.Add(item); replica2 = replica.Next(); } }
private bool method_0(string string_0, IWorkspaceReplicas iworkspaceReplicas_0) { ISQLSyntax syntax = iworkspaceReplicas_0 as ISQLSyntax; IEnumReplica replicas = iworkspaceReplicas_0.Replicas; replicas.Reset(); for (IReplica replica2 = replicas.Next(); replica2 != null; replica2 = replicas.Next()) { if (replica2.ReplicaRole == esriReplicaType.esriCheckOutTypeParent) { string str = syntax.QualifyTableName("", replica2.Owner, replica2.Version); if (string_0.ToLower() == str.ToLower()) { return(true); } } } return(false); }
private void method_12(IArray iarray_1, ICompositeLayer icompositeLayer_0) { for (int i = 0; i < icompositeLayer_0.Count; i++) { ILayer layer = icompositeLayer_0.get_Layer(i); if (layer is IGroupLayer) { this.method_12(iarray_1, layer as ICompositeLayer); } else if (layer is IFeatureLayer) { IFeatureLayer layer2 = layer as IFeatureLayer; IDataset featureClass = layer2.FeatureClass as IDataset; if ((featureClass != null) && !(featureClass is ICoverageFeatureClass)) { IWorkspace workspace = featureClass.Workspace; if (workspace.Type == esriWorkspaceType.esriRemoteDatabaseWorkspace) { if (workspace is IWorkspaceEdit) { IVersionedObject obj2 = layer2.FeatureClass as IVersionedObject; if (obj2.IsRegisteredAsVersioned) { (this.method_14(iarray_1, workspace).EnumName as IEnumNameEdit).Add( featureClass.FullName); } } } else if ((workspace.Type == esriWorkspaceType.esriLocalDatabaseWorkspace) && (workspace is IWorkspaceReplicas)) { IEnumReplica replicas = (workspace as IWorkspaceReplicas).Replicas; replicas.Reset(); if (replicas.Next() != null) { (this.method_14(this.iarray_0, workspace).EnumName as IEnumNameEdit).Add( featureClass.FullName); } } } } } }
private bool method_2(IWorkspace iworkspace_0, IEnumName ienumName_0) { if (!(iworkspace_0 is IWorkspaceReplicas)) { goto Label_009D; } IEnumReplica replicas = (iworkspace_0 as IWorkspaceReplicas).Replicas; replicas.Reset(); replicas.Next(); ienumName_0.Reset(); IDatasetName name = ienumName_0.Next() as IDatasetName; Label_003C: if (name != null) { bool flag = false; try { flag = this.method_1(iworkspace_0, name.Type, this.method_0(name).ToLower()); } catch { } while (!flag) { name = ienumName_0.Next() as IDatasetName; goto Label_003C; } if (this.chkResueSchema.Checked) { return(true); } MessageBox.Show("选择的导出空间数据库中有同名的要素集,如果要用该导出空间数据库,请在重用选项上打勾。"); return(false); } Label_009D: return(true); }
private void method_0() { this.textEditName.Text = this.iworkspace_0.PathName; switch (this.iworkspace_0.Type) { case esriWorkspaceType.esriLocalDatabaseWorkspace: if (!(Path.GetExtension(this.iworkspace_0.PathName).ToLower() == ".mdb")) { this.lblType.Text = "文件型空间数据库"; this.lblConfigKey.Text = "点击按钮列出数据库定义的所有关键字"; this.btnConfigKey.Enabled = true; break; } this.lblType.Text = "个人空间数据库"; this.lblConfigKey.Text = "个人空间数据库不支持配置关键字"; this.btnConfigKey.Enabled = false; break; case esriWorkspaceType.esriRemoteDatabaseWorkspace: this.lblType.Text = "ArcSDE Geodatebase连接"; this.lblConfigKey.Text = "点击按钮列出数据库定义的所有关键字"; this.btnConfigKey.Enabled = true; break; } if (this.iworkspace_0 is IWorkspaceReplicas) { IEnumReplica replicas = (this.iworkspace_0 as IWorkspaceReplicas).Replicas; replicas.Reset(); IReplica replica2 = replicas.Next(); string name = ""; if (replica2 != null) { this.lblCheckOutInfo.Text = "这是个检出数据库。该数据库包含从另外的数据库导出的数据。"; this.textEditCheckOutName.Enabled = true; name = replica2.Name; this.textEditCheckOutName.Text = name; this.btnProperty.Enabled = true; this.btnUnRegister.Enabled = true; } else { this.lblCheckOutInfo.Text = "该数据库不包含从另外的数据库导出的数据。"; this.textEditCheckOutName.Enabled = false; this.btnProperty.Enabled = false; this.btnUnRegister.Enabled = false; } } else { this.lblCheckOutInfo.Text = "该数据库不包含从另外的数据库导出的数据。"; this.textEditCheckOutName.Enabled = false; this.btnProperty.Enabled = false; this.btnUnRegister.Enabled = false; } try { IGeodatabaseRelease release = this.iworkspace_0 as IGeodatabaseRelease; if (release.CurrentRelease) { this.lblGDBRelease.Text = "此数据库与你所使用的ArcGIS版本匹配"; this.btnUpdatePersonGDB.Enabled = false; } else if (release.CanUpgrade) { this.lblGDBRelease.Text = "此数据库与你所使用的ArcGIS版本不匹配"; this.btnUpdatePersonGDB.Enabled = true; } else { this.btnUpdatePersonGDB.Enabled = false; } } catch { this.btnUpdatePersonGDB.Enabled = false; } }