本文整理汇总了C#中System.Utils.AbortEditing方法的典型用法代码示例。如果您正苦于以下问题:C# Utils.AbortEditing方法的具体用法?C# Utils.AbortEditing怎么用?C# Utils.AbortEditing使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Utils
的用法示例。
在下文中一共展示了Utils.AbortEditing方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnClick
//.........这里部分代码省略.........
if (MissingPlansDialog.radioBtnUserDef.Checked)
{ //create a NEW plan named with user's entered text
ArrayList sPlanInserts = new ArrayList();
pSchemaEd.ReleaseReadOnlyFields(pPlansTable, esriCadastralFabricTable.esriCFTPlans); //release safety-catch
sPlanInserts.Add(MissingPlansDialog.txtPlanName.Text);
FabricUTILS.InsertPlanRecords(pPlansTable, sPlanInserts,iUnitsAndFormat,PlansList, bIsUnVersioned,
null, null, ref PlanLookUp);
if (!PlanLookUp.TryGetValue(MissingPlansDialog.txtPlanName.Text, out iNewPlanID))
{
Cleanup(null, null, pTable, pPlansTable, pWS, pProgressorDialog, true);
FabricUTILS = null;
return;
}
}
if (MissingPlansDialog.radioBtnPlanID.Checked)
{//create multiple new plans for each PlanID
ArrayList sPlanInserts = new ArrayList();
foreach (ListViewItem listItem in MissingPlansDialog.listViewByGroup.CheckedItems)
sPlanInserts.Add("[" + listItem.SubItems[0].Text + "]");
pSchemaEd.ReleaseReadOnlyFields(pPlansTable, esriCadastralFabricTable.esriCFTPlans); //release safety-catch
FabricUTILS.InsertPlanRecords(pPlansTable, sPlanInserts, iUnitsAndFormat, PlansList, bIsUnVersioned,
null, null, ref PlanLookUp);
}
ArrayList sParcelUpdates = new ArrayList();
sParcelUpdates.Add("");
int i = 0;
int iCnt = 0;
int iTokenLimit = 995;
foreach (ListViewItem listItem in MissingPlansDialog.listView1.CheckedItems)
{
string s = listItem.SubItems[1].Text;
string[] sItems = Regex.Split(s, "id:");
if (iCnt >= iTokenLimit)//time to start a new row
{
sParcelUpdates.Add("");//add a new item to the arraylist
iCnt = 0;//reset token counter
i++;//increment array index
}
sItems[1] = sItems[1].Remove(sItems[1].LastIndexOf(")"));
if (iCnt == 0)
sParcelUpdates[i] += sItems[1];
else
sParcelUpdates[i] += "," + sItems[1];
iCnt++;
}
//============edit block==========
try
{
pSchemaEd.ReleaseReadOnlyFields(pTable, esriCadastralFabricTable.esriCFTParcels); //release safety-catch
if (MissingPlansDialog.radioBtnUserDef.Checked || MissingPlansDialog.radioBtnExistingPlan.Checked)
{
if (!FabricUTILS.UpdateParcelRecords(pTable, sParcelUpdates, iNewPlanID, bIsUnVersioned,
m_pStepProgressor, m_pTrackCancel))
{
pSchemaEd.ResetReadOnlyFields(esriCadastralFabricTable.esriCFTParcels);
pSchemaEd.ResetReadOnlyFields(esriCadastralFabricTable.esriCFTPlans);
FabricUTILS.AbortEditing(pWS);
Cleanup(null, null, pTable, pPlansTable, pWS, pProgressorDialog, true);
FabricUTILS = null;
return;
}
}
if (MissingPlansDialog.radioBtnPlanID.Checked)
{
if (!FabricUTILS.UpdateParcelRecordsByPlanGroup(pTable, sParcelUpdates, PlanLookUp,
ParcelLookup, bIsUnVersioned, m_pStepProgressor, m_pTrackCancel))
{
pSchemaEd.ResetReadOnlyFields(esriCadastralFabricTable.esriCFTParcels);
pSchemaEd.ResetReadOnlyFields(esriCadastralFabricTable.esriCFTPlans);
FabricUTILS.AbortEditing(pWS);
Cleanup(null, null, pTable, pPlansTable, pWS, pProgressorDialog, true);
FabricUTILS = null;
return;
}
}
pSchemaEd.ResetReadOnlyFields(esriCadastralFabricTable.esriCFTParcels);
pSchemaEd.ResetReadOnlyFields(esriCadastralFabricTable.esriCFTPlans);
FabricUTILS.StopEditing(pWS);
//Cleanup(null, null, pTable, pPlansTable, pWS, pProgressorDialog, true);
//FabricUTILS = null;
}
catch (COMException Ex)
{
MessageBox.Show(Ex.ErrorCode.ToString() +":" + Ex.Message,"Fix Missing Plans");
}
finally
{
Cleanup(null, null, pTable, pPlansTable, pWS, pProgressorDialog, true);
FabricUTILS = null;
}
}
示例2: OnClick
//.........这里部分代码省略.........
MessageBox.Show("There was a problem searching for repeat plans.", "Merge plans by name");
}
SummaryNames = null;
RepeatPlans = null;
Cleanup(pMouseCursor, null, pTable, pPlansTable, pWS, pProgressorDialog);
return;
}
dlgMergeSameNamePlans TheSummaryDialog = new dlgMergeSameNamePlans();
FillTheSummaryList(TheSummaryDialog, SummaryNames);
DialogResult dResult = TheSummaryDialog.ShowDialog();
if (dResult == DialogResult.Cancel)
{
pProgressorDialog.HideDialog();
SummaryNames = null;
RepeatPlans = null;
Cleanup(pMouseCursor, null,pTable, pPlansTable, pWS, pProgressorDialog);
pPlansTable = null;
return;
}
//get the time now
m_pStartTime = new TimeClass();
m_pStartTime.SetFromCurrentLocalTime();
Dictionary<int, int> Lookup = new Dictionary<int, int>();
string[] InClause = new string[0]; //define as dynamic array
m_pStepProgressor.Message = "Creating the merge query...";
FabricUTILS.BuildSearchMapAndQuery(RepeatPlans, out Lookup, out InClause, out pPlansToDelete);
ICadastralFabricSchemaEdit2 pSchemaEd = (ICadastralFabricSchemaEdit2)m_pCadaFab;
ITable ParcelTable = m_pCadaFab.get_CadastralTable(esriCadastralFabricTable.esriCFTParcels);
pSchemaEd.ReleaseReadOnlyFields(ParcelTable, esriCadastralFabricTable.esriCFTParcels); //release safety-catch
if (!FabricUTILS.StartEditing(pWS, bIsUnVersioned))
{
Cleanup(pMouseCursor, pPlansToDelete,pTable, pPlansTable, pWS, pProgressorDialog);
InClause = null;
Lookup.Clear();
Lookup = null;
return;
}
//setup progressor dialog for merge
m_pStepProgressor.Message = "Moving parcels from source to target plans...";
if (!FabricUTILS.MergePlans(ParcelTable, Lookup, InClause, bIsUnVersioned,m_pStepProgressor,m_pTrackCancel))
{
FabricUTILS.AbortEditing(pWS);
pSchemaEd.ResetReadOnlyFields(esriCadastralFabricTable.esriCFTParcels);
Cleanup(pMouseCursor, pPlansToDelete,pTable,pPlansTable, pWS,pProgressorDialog);
InClause = null;
Lookup.Clear();
Lookup = null;
return;
}
if (TheSummaryDialog.checkBox1.Checked)
{
//setup progressor dialog for Delete
m_pStepProgressor.MaxRange = pPlansToDelete.Count();
m_pStepProgressor.Message = "Deleting source plans...";
if (bIsUnVersioned)
{
if (!FabricUTILS.DeleteRowsUnversioned(pWS, pPlansTable, pPlansToDelete, m_pStepProgressor, m_pTrackCancel))
Cleanup(pMouseCursor, pPlansToDelete,pTable,pPlansTable,pWS,pProgressorDialog);
}
else
{
if (!FabricUTILS.DeleteRowsByFIDSet(pPlansTable, pPlansToDelete, m_pStepProgressor, m_pTrackCancel))
Cleanup(pMouseCursor, pPlansToDelete,pTable,pPlansTable, pWS,pProgressorDialog);
}
}
pSchemaEd.ResetReadOnlyFields(esriCadastralFabricTable.esriCFTParcels);
m_pEndTime = new TimeClass();
m_pEndTime.SetFromCurrentLocalTime();
ITimeDuration HowLong = m_pEndTime.SubtractTime(m_pStartTime);
m_pStepProgressor.Message = "["
+ HowLong.Hours.ToString("00") + "h "
+ HowLong.Minutes.ToString("00") + "m "
+ HowLong.Seconds.ToString("00") + "s]" + " Saving changes...please wait.";
FabricUTILS.StopEditing(pWS);
Cleanup(pMouseCursor, pPlansToDelete,pTable,pPlansTable, pWS,pProgressorDialog);
}
catch (COMException ex)
{
MessageBox.Show(Convert.ToString(ex.ErrorCode));
Cleanup(pMouseCursor, pPlansToDelete,pTable,null,pWS,null);
}
}