本文整理汇总了C#中ESRI.set_Value方法的典型用法代码示例。如果您正苦于以下问题:C# ESRI.set_Value方法的具体用法?C# ESRI.set_Value怎么用?C# ESRI.set_Value使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ESRI
的用法示例。
在下文中一共展示了ESRI.set_Value方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: intersectLayerDetailsFunctions
private void intersectLayerDetailsFunctions(ILayer pLay, List<IGeometry> pGeos, AAState.intersectOptions strOpt, ref bool found,
ref List<Globals.OptionsToPresent> strFiles, ref ESRI.ArcGIS.Geodatabase.IObject inObject, int intFldIdx, List<string> MatchPattern)
{
AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorChain194") + pLay.Name);
IRasterLayer pRasLay = null;
IEnvelope pEnv = null;
IRelationalOperator pRel = null;
IRelationalOperator2 pRel2 = null;
ISpatialFilter pSpatFilt = null;
IFeatureLayer pFLay = null;
try
{
if (pLay is IRasterLayer)
{
pRasLay = pLay as IRasterLayer;
AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorChain195") + pRasLay.Name);
pEnv = pRasLay.AreaOfInterest;
pRel = pEnv as IRelationalOperator;
pRel2 = pEnv as IRelationalOperator2;
foreach (IGeometry pGeo in pGeos)
{
if (pRel.Crosses(pGeo) || pRel.Touches(pGeo) || pRel.Overlaps(pGeo) || pRel2.ContainsEx(pGeo, esriSpatialRelationExEnum.esriSpatialRelationExClementini))
{
AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorChain196") + pRasLay.Name);
string pathForLay = Globals.GetPathForALayer(pLay);
switch (formatString)
{
case "P":
if (MatchPattern == null)
{
if (strOpt == AAState.intersectOptions.PromptMulti)
{
if (!strFiles.Contains(new Globals.OptionsToPresent(0, pathForLay, pathForLay, pathForLay)))
{
strFiles.Add(new Globals.OptionsToPresent(0, pathForLay, pathForLay, pathForLay));
}
}
else
{
inObject.set_Value(intFldIdx, pathForLay);
pRasLay = null;
pEnv = null;
pRel = null;
pRel2 = null;
found = true;
return;
}
}
else if (MatchPattern.Count == 0)
{
if (strOpt == AAState.intersectOptions.PromptMulti)
{
if (!strFiles.Contains(new Globals.OptionsToPresent(0, pathForLay, pathForLay, pathForLay)))
{
strFiles.Add(new Globals.OptionsToPresent(0, pathForLay, pathForLay, pathForLay));
}
}
else
{
inObject.set_Value(intFldIdx, pathForLay);
pRasLay = null;
pEnv = null;
pRel = null;
pRel2 = null;
found = true;
return;
}
}
else
{
foreach (string MatPat in MatchPattern)
{
if (pathForLay.ToUpper().Contains(MatPat.ToUpper()) || pLay.Name.ToUpper().Contains(MatPat.ToUpper()))
{
if (strOpt == AAState.intersectOptions.PromptMulti)
{
if (!strFiles.Contains(new Globals.OptionsToPresent(0, pathForLay, pathForLay, pathForLay)))
{
strFiles.Add(new Globals.OptionsToPresent(0, pathForLay, pathForLay, pathForLay));
}
}
else
{
inObject.set_Value(intFldIdx, pathForLay);
pRasLay = null;
pEnv = null;
pRel = null;
//.........这里部分代码省略.........
开发者ID:rlwarford,项目名称:local-government-desktop-addins,代码行数:101,代码来源:AttributeAssistantEditorExtension.cs
示例2: ConfigureCable
/// <summary>
/// Sets the buffer tube and strand counts based on the given configuration. If IPID and/or CABLEID are null, it also
/// takes care of them
/// </summary>
/// <param name="feature">The FiberCable feature to configure</param>
/// <param name="configuration">The tube/strand counts</param>
/// <param name="isExistingOperation">Flag to control whether this method is being called from within an existing
/// edit operation</param>
/// <returns>Success</returns>
protected bool ConfigureCable(ESRI.ArcGIS.Geodatabase.IFeature feature, FiberCableConfiguration configuration, bool isExistingOperation)
{
bool isComplete = false;
bool isOurOperationOpen = false;
// The following assignments are defaults for the case where they are not already populated on the feature
string fiberCableIpid = Guid.NewGuid().ToString("B").ToUpper();
// The following will be set during Validation
ESRI.ArcGIS.Geodatabase.IObjectClass ftClass = null;
ESRI.ArcGIS.Geodatabase.IFields fields = null;
int ipidIdx = -1;
int bufferCountIdx = -1;
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)
{
//.........这里部分代码省略.........
示例3: ConfigureDevice
/// <summary>
/// Sets the input and output ports based on the given configuration. If IPID and/or CABLEID are null, it also
/// takes care of them
/// </summary>
/// <param name="feature">The device feature to configure</param>
/// <param name="inputPorts">Number of input ports</param>
/// <param name="outputPorts">Number of output ports</param>
/// <param name="isExistingOperation">Flag to control whether this method is being called from within an existing
/// edit operation -- the default behavior is "false" in which case it adds an operation of its own</param>
/// <returns>True if the configuration is complete</returns>
public bool ConfigureDevice(ESRI.ArcGIS.Geodatabase.IFeature feature, int inputPorts, int outputPorts, bool isExistingOperation)
{
bool isComplete = false;
bool isOurOperationOpen = false;
string deviceIpid = string.Empty;
#region Validation
string missingFieldFormat = "Field {0} is missing.";
// The following will be set during Validation
ESRI.ArcGIS.Geodatabase.IObjectClass ftClass = null;
ESRI.ArcGIS.Geodatabase.IFields fields = null;
ftClass = feature.Class;
fields = ftClass.Fields;
if (null == feature)
{
throw new ArgumentNullException("feature");
}
if (_editor.EditState == ESRI.ArcGIS.Editor.esriEditState.esriStateNotEditing)
{
throw new InvalidOperationException("You must be editing the workspace to perform this operation.");
}
if (0 > inputPorts)
{
throw new ArgumentOutOfRangeException("inputPorts");
}
if (0 > outputPorts)
{
throw new ArgumentOutOfRangeException("outputPorts");
}
int ipidIdx = fields.FindField(ConfigUtil.IpidFieldName);
if (-1 == ipidIdx)
{
throw new InvalidOperationException(string.Format(missingFieldFormat, ConfigUtil.IpidFieldName));
}
int inPortsIdx = fields.FindField(ConfigUtil.InputPortsFieldName);
if (-1 == inPortsIdx)
{
throw new InvalidOperationException(string.Format(missingFieldFormat, ConfigUtil.InputPortsFieldName));
}
int outPortsIdx = fields.FindField(ConfigUtil.OutputPortsFieldName);
if (-1 == outPortsIdx)
{
throw new InvalidOperationException(string.Format(missingFieldFormat, ConfigUtil.OutputPortsFieldName));
}
#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);
//.........这里部分代码省略.........