本文整理汇总了C#中ESRI.Continue方法的典型用法代码示例。如果您正苦于以下问题:C# ESRI.Continue方法的具体用法?C# ESRI.Continue怎么用?C# ESRI.Continue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ESRI
的用法示例。
在下文中一共展示了ESRI.Continue方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GenerateUnits
/// <summary>
/// Generates a number of buffer tubes and fiber records for a fiber cable, given a configuration.
/// </summary>
/// <param name="feature">IFeature to generate for</param>
/// <param name="configuration">Specification of buffer and fiber counts</param>
/// <param name="progressDialog">Progress dialog for user notification</param>
/// <param name="trackCancel">TrackCancel used in the progress dialog</param>
/// <returns>Success</returns>
private bool GenerateUnits(ESRI.ArcGIS.Geodatabase.IFeature feature, FiberCableConfiguration configuration, ESRI.ArcGIS.Framework.IProgressDialog2 progressDialog, ESRI.ArcGIS.esriSystem.ITrackCancel trackCancel)
{
bool isComplete = false;
bool isCancelled = false;
Guid g;
ESRI.ArcGIS.esriSystem.IStepProgressor stepProgressor = (ESRI.ArcGIS.esriSystem.IStepProgressor)progressDialog;
ESRI.ArcGIS.Geodatabase.IObjectClass ftClass = feature.Class;
using (ESRI.ArcGIS.ADF.ComReleaser releaser = new ESRI.ArcGIS.ADF.ComReleaser())
{
ESRI.ArcGIS.Geodatabase.IRelationshipClass cableHasBuffer = GdbUtils.GetRelationshipClass(ftClass, ConfigUtil.FiberCableToBufferRelClassName);
releaser.ManageLifetime(cableHasBuffer);
ESRI.ArcGIS.Geodatabase.IRelationshipClass cableHasFiber = GdbUtils.GetRelationshipClass(ftClass, ConfigUtil.FiberCableToFiberRelClassName);
releaser.ManageLifetime(cableHasFiber);
ESRI.ArcGIS.Geodatabase.IRelationshipClass bufferHasFiber = GdbUtils.GetRelationshipClass(ftClass, ConfigUtil.BufferToFiberRelClassName);
releaser.ManageLifetime(bufferHasFiber);
ESRI.ArcGIS.Geodatabase.ITable bufferTable = cableHasBuffer.DestinationClass as ESRI.ArcGIS.Geodatabase.ITable;
ESRI.ArcGIS.Geodatabase.ITable fiberTable = cableHasFiber.DestinationClass as ESRI.ArcGIS.Geodatabase.ITable;
// Fields to populate on buffer
int bufferIpidIdx = bufferTable.Fields.FindField(ConfigUtil.IpidFieldName);
int fiberCountIdx = bufferTable.Fields.FindField(ConfigUtil.NumberOfFibersFieldName);
int bufferToCableIdx = bufferTable.Fields.FindField(cableHasBuffer.OriginForeignKey);
object bufferToCableValue = feature.get_Value(feature.Fields.FindField(cableHasBuffer.OriginPrimaryKey));
// Fields to populate on fiber
int fiberIpidIdx = fiberTable.Fields.FindField(ConfigUtil.IpidFieldName);
int fiberNumberIdx = fiberTable.Fields.FindField(ConfigUtil.Fiber_NumberFieldName);
int fiberToCableIdx = fiberTable.Fields.FindField(cableHasFiber.OriginForeignKey);
object fiberToCableValue = feature.get_Value(feature.Fields.FindField(cableHasFiber.OriginPrimaryKey));
int fiberToBufferIdx = fiberTable.Fields.FindField(bufferHasFiber.OriginForeignKey);
int fiberToBufferValueIdx = bufferTable.Fields.FindField(bufferHasFiber.OriginPrimaryKey);
// Research using InsertCursor for speed.
int fiberNumber = 0;
for (int bufferIdx = 1; bufferIdx <= configuration.BufferCount; bufferIdx++)
{
g = Guid.NewGuid();
string bufferId = g.ToString("B").ToUpper();
ESRI.ArcGIS.Geodatabase.IRow row = bufferTable.CreateRow();
releaser.ManageLifetime(row);
row.set_Value(bufferIpidIdx, bufferId);
row.set_Value(fiberCountIdx, configuration.FibersPerTube);
row.set_Value(bufferToCableIdx, bufferToCableValue);
row.Store();
object fiberToBufferValue = row.get_Value(fiberToBufferValueIdx);
// Research using InsertCursor for speed.
for (int fiberIdx = 1; fiberIdx <= configuration.FibersPerTube; fiberIdx++)
{
fiberNumber++;
progressDialog.Description = string.Format("Creating fiber {0} of {1}", fiberNumber, configuration.TotalFiberCount);
stepProgressor.Step();
g = Guid.NewGuid();
ESRI.ArcGIS.Geodatabase.IRow fiberRow = fiberTable.CreateRow();
releaser.ManageLifetime(fiberRow);
fiberRow.set_Value(fiberIpidIdx, g.ToString("B").ToUpper());
fiberRow.set_Value(fiberNumberIdx, fiberNumber);
fiberRow.set_Value(fiberToBufferIdx, fiberToBufferValue);
fiberRow.set_Value(fiberToCableIdx, fiberToCableValue);
fiberRow.Store();
if (!trackCancel.Continue())
{
isCancelled = true;
break;
}
}
if (!trackCancel.Continue())
{
isCancelled = true;
break;
}
}
if (!isCancelled)
{
isComplete = true;
}
}
return isComplete;
//.........这里部分代码省略.........
示例2: Apply
public void Apply(ISchematicInMemoryDiagram inMemoryDiagram, ESRI.ArcGIS.esriSystem.ITrackCancel cancelTracker)
{
if (m_reducedNodeClassName == "" || inMemoryDiagram == null) return;
// initialize the schematic rules helper
ISchematicRulesHelper rulesHelper = new SchematicRulesHelperClass();
rulesHelper.InitHelper(inMemoryDiagram);
rulesHelper.KeepVertices = m_keepVertices;
////////////////////////
// get the feature classes processed by the rule
ISchematicDiagramClass diagramClass = null;
try
{
diagramClass = inMemoryDiagram.SchematicDiagramClass;
}
catch { }
if (diagramClass == null) return;
ISchematicDataset schematicDataset = null;
try
{
schematicDataset = diagramClass.SchematicDataset;
}
catch { }
ISchematicElementClassContainer elementclassContainer = (ISchematicElementClassContainer)schematicDataset;
if (elementclassContainer == null) return;
ISchematicElementClass elementClassReducedNode = null;
elementClassReducedNode = elementclassContainer.GetSchematicElementClass(m_reducedNodeClassName);
ISchematicElementClass elementClassSuperspan = null;
elementClassSuperspan = elementclassContainer.GetSchematicElementClass(m_superspanLinkClassName);
if (elementClassSuperspan == null || elementClassReducedNode == null) return;
ISchematicInMemoryFeatureClassContainer featureClassContainer = (ISchematicInMemoryFeatureClassContainer)inMemoryDiagram;
if (featureClassContainer == null) return;
ISchematicInMemoryFeatureClass superspanLinkClass = featureClassContainer.GetSchematicInMemoryFeatureClass(elementClassSuperspan);
//
/////////////////////////
// fetch the superspan spatial reference
IGeoDataset geoDataset = (IGeoDataset)superspanLinkClass;
ISpatialReference spatialRef = null;
if (geoDataset != null) spatialRef = geoDataset.SpatialReference;
if (spatialRef == null) return;
// Retrieve the schematic in memory feature nodes to reduce
System.Collections.Generic.Dictionary<string, ISchematicInMemoryFeature> colSchfeatureNode = new Dictionary<string, ISchematicInMemoryFeature>();
// get all feature of parent node class
IEnumSchematicInMemoryFeature enumSchematicInMemoryFeature = inMemoryDiagram.GetSchematicInMemoryFeaturesByClass(elementClassReducedNode);
// retain only the nodes of degree two
RetainNodesDegreeTwo(enumSchematicInMemoryFeature, colSchfeatureNode, rulesHelper); // there would be inserted a SQL query to also filter by attributes
IProgressor msgProgressor = null;
if (cancelTracker != null)
{
msgProgressor = cancelTracker.Progressor;
IStepProgressor stepProgressor = (IStepProgressor)msgProgressor;
if (stepProgressor != null)
{
stepProgressor.MinRange = 0;
stepProgressor.MaxRange = colSchfeatureNode.Count;
stepProgressor.StepValue = 1;
stepProgressor.Position = 0;
stepProgressor.Message = m_description;
cancelTracker.Reset();
cancelTracker.Progressor = msgProgressor;
stepProgressor.Show();
}
}
ISchematicInMemoryFeature schFeatureToReduce;
foreach (KeyValuePair<string, ISchematicInMemoryFeature> kvp in colSchfeatureNode)
{
if (cancelTracker != null)
if (cancelTracker.Continue() == false)
break;
schFeatureToReduce = colSchfeatureNode[kvp.Key];
if (schFeatureToReduce != null) ReduceNode(rulesHelper, superspanLinkClass, spatialRef, schFeatureToReduce);
}
// release memory
colSchfeatureNode.Clear();
colSchfeatureNode = null;
rulesHelper = null;
}
示例3: Draw
public void Draw(ESRI.ArcGIS.Geodatabase.IFeatureCursor cursor, ESRI.ArcGIS.esriSystem.esriDrawPhase DrawPhase, ESRI.ArcGIS.Display.IDisplay Display, ESRI.ArcGIS.esriSystem.ITrackCancel TrackCancel)
{
bool bContinue = true;
IFeature pFeat = null;
IFeatureDraw pFeatDraw = null;
ISymbol pFeatSymbol = null;
try
{
if (FeatureSelection != null)
this.SelectedOIDs = this.UpdateSelectedOIDs(FeatureSelection);
pFeat = cursor.NextFeature();
while (((pFeat != null) && bContinue == true))
{
pFeatDraw = pFeat as IFeatureDraw;
pFeatSymbol = GetFeatureSymbol(pFeat);
Display.SetSymbol(pFeatSymbol);
pFeatDraw.Draw(DrawPhase, Display, pFeatSymbol, true, null, esriDrawStyle.esriDSNormal);
pFeat = cursor.NextFeature();
if ((TrackCancel != null))
{
bContinue = TrackCancel.Continue();
}
}
}
catch (Exception ex)
{
// EngineLogger.Logger.LogException(ex);
}
finally
{
bContinue = false;
pFeat = null;
pFeatDraw = null;
pFeatSymbol = null;
}
}
示例4: GeneratePorts
/// <summary>
/// Generate the ports for a given device
/// </summary>
/// <param name="device">The device feature</param>
/// <returns>True if completed</returns>
private bool GeneratePorts(ESRI.ArcGIS.Geodatabase.IFeature device, int lowInputPort, int inputPortCount, int lowOutputPort, int outputPortCount, ESRI.ArcGIS.Framework.IProgressDialog2 progressDialog, ESRI.ArcGIS.esriSystem.ITrackCancel trackCancel)
{
bool isCancelled = false;
ESRI.ArcGIS.esriSystem.IStepProgressor stepProgressor = (ESRI.ArcGIS.esriSystem.IStepProgressor)progressDialog;
ESRI.ArcGIS.Geodatabase.IRelationshipClass deviceHasPorts = ConfigUtil.GetPortRelationship((ESRI.ArcGIS.Geodatabase.IFeatureClass)device.Class);
Guid g;
if (null != deviceHasPorts)
{
using (ESRI.ArcGIS.ADF.ComReleaser releaser = new ESRI.ArcGIS.ADF.ComReleaser())
{
ESRI.ArcGIS.Geodatabase.ITable portTable = (ESRI.ArcGIS.Geodatabase.ITable)deviceHasPorts.DestinationClass;
releaser.ManageLifetime(portTable);
// Fields to populate on port
int portIpidIdx = portTable.Fields.FindField(ConfigUtil.IpidFieldName);
int portNumberIdx = portTable.Fields.FindField(ConfigUtil.PortIdFieldName);
int portTypeIdx = portTable.Fields.FindField(ConfigUtil.PortTypeFieldName);
int fkeyIdx = portTable.Fields.FindField(deviceHasPorts.OriginForeignKey);
object originPrimaryKey = device.get_Value(device.Fields.FindField(deviceHasPorts.OriginPrimaryKey));
for (int portIdx = lowInputPort; portIdx <= inputPortCount; portIdx++)
{
stepProgressor.Message = string.Format("Creating input port {0} of {1}", portIdx, inputPortCount);
stepProgressor.Step();
g = Guid.NewGuid();
string portIpid = g.ToString("B").ToUpper();
ESRI.ArcGIS.Geodatabase.IRow portRow = portTable.CreateRow();
releaser.ManageLifetime(portRow);
portRow.set_Value(portIpidIdx, portIpid);
portRow.set_Value(portTypeIdx, PortType.Input);
portRow.set_Value(portNumberIdx, portIdx);
portRow.set_Value(fkeyIdx, originPrimaryKey);
portRow.Store();
if (!trackCancel.Continue())
{
isCancelled = true;
break;
}
}
if (trackCancel.Continue())
{
for (int portIdx = lowOutputPort; portIdx <= outputPortCount; portIdx++)
{
stepProgressor.Message = string.Format("Creating output port {0} of {1}", portIdx, outputPortCount);
stepProgressor.Step();
g = Guid.NewGuid();
string portIpid = g.ToString("B").ToUpper();
ESRI.ArcGIS.Geodatabase.IRow portRow = portTable.CreateRow();
releaser.ManageLifetime(portRow);
portRow.set_Value(portIpidIdx, portIpid);
portRow.set_Value(portTypeIdx, PortType.Output);
portRow.set_Value(portNumberIdx, portIdx);
portRow.set_Value(fkeyIdx, originPrimaryKey);
portRow.Store();
if (!trackCancel.Continue())
{
isCancelled = true;
break;
}
}
}
}
}
return !isCancelled;
}