本文整理汇总了C#中ESRI.Store方法的典型用法代码示例。如果您正苦于以下问题:C# ESRI.Store方法的具体用法?C# ESRI.Store怎么用?C# ESRI.Store使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ESRI
的用法示例。
在下文中一共展示了ESRI.Store方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ConfigureCable
//.........这里部分代码省略.........
int strandCountIdx = -1;
#region Validation
if (null == feature)
{
throw new ArgumentNullException("feature");
}
if (null == configuration)
{
throw new ArgumentNullException("configuration");
}
if (_editor.EditState == ESRI.ArcGIS.Editor.esriEditState.esriStateNotEditing)
{
throw new InvalidOperationException("You must be editing the workspace to perform this operation.");
}
ftClass = feature.Class;
fields = ftClass.Fields;
string missingFieldFormat = "Field {0} is missing.";
ipidIdx = fields.FindField(ConfigUtil.IpidFieldName);
if (-1 == ipidIdx)
{
throw new InvalidOperationException(string.Format(missingFieldFormat, ConfigUtil.IpidFieldName));
}
bufferCountIdx = fields.FindField(ConfigUtil.NumberOfBuffersFieldName);
if (-1 == bufferCountIdx)
{
throw new InvalidOperationException(string.Format(missingFieldFormat, ConfigUtil.NumberOfBuffersFieldName));
}
strandCountIdx = fields.FindField(ConfigUtil.NumberOfFibersFieldName);
if (-1 == strandCountIdx)
{
throw new InvalidOperationException(string.Format(missingFieldFormat, ConfigUtil.NumberOfFibersFieldName));
}
#endregion
ESRI.ArcGIS.esriSystem.ITrackCancel trackCancel = new ESRI.ArcGIS.Display.CancelTrackerClass();
ESRI.ArcGIS.Framework.IProgressDialog2 progressDialog = _hookHelper.CreateProgressDialog(trackCancel, "Preparing to configure cable...", 1, configuration.TotalFiberCount, 1, "Starting edit operation...", "Fiber Configuration");
ESRI.ArcGIS.esriSystem.IStepProgressor stepProgressor = (ESRI.ArcGIS.esriSystem.IStepProgressor)progressDialog;
progressDialog.ShowDialog();
stepProgressor.Step();
if (!isExistingOperation)
{
_editor.StartOperation();
isOurOperationOpen = true;
}
try
{
if (DBNull.Value == feature.get_Value(ipidIdx))
{
feature.set_Value(ipidIdx, fiberCableIpid);
}
else
{
fiberCableIpid = feature.get_Value(ipidIdx).ToString();
}
feature.set_Value(bufferCountIdx, configuration.BufferCount);
feature.set_Value(strandCountIdx, configuration.TotalFiberCount);
isComplete = GenerateUnits(feature, configuration, progressDialog, trackCancel);
progressDialog.Description = "Completing configuration...";
stepProgressor.Step();
if (isOurOperationOpen)
{
if (isComplete)
{
feature.Store();
_editor.StopOperation("Configure Fiber");
}
else
{
_editor.AbortOperation();
}
}
}
catch
{
if (isOurOperationOpen)
{
_editor.AbortOperation();
}
}
progressDialog.HideDialog();
return isComplete;
}
示例2: ConfigureDevice
//.........这里部分代码省略.........
}
#endregion
// Are we RE-configuring?
// int? oldInputPorts = GdbUtils.GetDomainedIntName(feature, ConfigUtil.InputPortsFieldName);
// int? oldOutputPorts = GdbUtils.GetDomainedIntName(feature, ConfigUtil.OutputPortsFieldName);
// int inputPortDifference = oldInputPorts.HasValue ? Math.Abs(inputPorts - oldInputPorts.Value) : inputPorts;
// int outputPortDifference = oldOutputPorts.HasValue ? Math.Abs(outputPorts - oldOutputPorts.Value) : outputPorts;
ESRI.ArcGIS.esriSystem.ITrackCancel trackCancel = new ESRI.ArcGIS.Display.CancelTrackerClass();
ESRI.ArcGIS.Framework.IProgressDialog2 progressDialog = _hookHelper.CreateProgressDialog(trackCancel, "Configuring device...", 1, inputPorts + outputPorts, 1, "Starting edit operation...", "Device Configuration");
// ESRI.ArcGIS.Framework.IProgressDialog2 progressDialog = CreateProgressDialog(trackCancel, "Configuring device...", 1, inputPortDifference + outputPortDifference + 2, 1, "Starting edit operation...", "Device Configuration");
ESRI.ArcGIS.esriSystem.IStepProgressor stepProgressor = (ESRI.ArcGIS.esriSystem.IStepProgressor)progressDialog;
progressDialog.ShowDialog();
stepProgressor.Step();
if (!isExistingOperation)
{
try
{
_editor.StartOperation();
isOurOperationOpen = true;
}
catch (Exception ex)
{
throw new Exception("Failed to start edit operation.", ex);
}
}
try
{
feature.set_Value(inPortsIdx, inputPorts);
feature.set_Value(outPortsIdx, outputPorts);
if (DBNull.Value == feature.get_Value(ipidIdx))
{
Guid g = Guid.NewGuid();
deviceIpid = g.ToString("B").ToUpper();
feature.set_Value(ipidIdx, deviceIpid);
}
else
{
deviceIpid = feature.get_Value(ipidIdx).ToString();
}
// if (!oldOutputPorts.HasValue && !oldInputPorts.HasValue)
// {
isComplete = GeneratePorts(feature, 1, inputPorts, 1, outputPorts, progressDialog, trackCancel);
// }
// else
// {
// bool additionsComplete = false;
// bool deletionsComplete = false;
//
// additionsComplete = GeneratePorts(feature, oldInputPorts.Value + 1, oldInputPorts.Value + inputPortDifference, oldOutputPorts.Value + 1, oldOutputPorts.Value + outputPortDifference, progressDialog, trackCancel);
// deletionsComplete = DeletePorts(feature, inputPorts, outputPorts, progressDialog, trackCancel);
//
// isComplete = additionsComplete && deletionsComplete;
// }
if (isComplete)
{
stepProgressor.Message = "Finishing configuration...";
stepProgressor.Step();
if (isOurOperationOpen)
{
feature.Store();
_editor.StopOperation("Configure Device");
}
}
else
{
stepProgressor.Message = "Cancelling configuration...";
stepProgressor.Step();
if (isOurOperationOpen)
{
_editor.AbortOperation();
}
}
}
catch
{
if (isOurOperationOpen)
{
_editor.AbortOperation();
}
}
if (null != progressDialog)
{
progressDialog.HideDialog();
}
return isComplete;
}