本文整理汇总了C#中ESRI.Reset方法的典型用法代码示例。如果您正苦于以下问题:C# ESRI.Reset方法的具体用法?C# ESRI.Reset怎么用?C# ESRI.Reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ESRI
的用法示例。
在下文中一共展示了ESRI.Reset方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Initialize
public void Initialize(ref ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeature relatedElements)
{
m_currentIndex = 0;
m_listElements = new System.Collections.Generic.List<ESRI.ArcGIS.Schematic.ISchematicInMemoryFeature>();
relatedElements.Reset();
ESRI.ArcGIS.Schematic.ISchematicInMemoryFeature schemElement = relatedElements.Next();
// add all Schematic feature to the list
while ((schemElement != null) && (m_listElements.Count < m_maxElements))
{
m_listElements.Add(schemElement);
schemElement = relatedElements.Next();
}
}
示例2: SelectReduction
public bool SelectReduction(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNode node, ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeature enumLink, ref ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLink link)
{
// if enumLink is empty do nothing
if (enumLink == null) return false;
if (enumLink.Count == 0) return false;
enumLink.Reset();
ESRI.ArcGIS.Schematic.ISchematicInMemoryFeature schemAssociatedLink;
schemAssociatedLink = enumLink.Next();
// for each link in enumLink
while (schemAssociatedLink != null)
{
// get cables
ESRI.ArcGIS.Geodatabase.IFeature cablesFeature;
cablesFeature = schemAssociatedLink.SchematicElement as ESRI.ArcGIS.Geodatabase.IFeature;
if (cablesFeature == null) return false;
// get cables class
ESRI.ArcGIS.Geodatabase.IDataset cablesDataset;
cablesDataset = (ESRI.ArcGIS.Geodatabase.IDataset)cablesFeature.Class;
// if not the right class do nothing
if (cablesDataset.Name.IndexOf("cables") == 0) return false;
// get workspace
ESRI.ArcGIS.Geodatabase.IFeatureWorkspace cablesWorkspace;
cablesWorkspace = (ESRI.ArcGIS.Geodatabase.IFeatureWorkspace)cablesDataset.Workspace;
// open table cables_attributes
ESRI.ArcGIS.Geodatabase.ITable cablesTable;
cablesTable = cablesWorkspace.OpenTable("cables_attributes");
if (cablesTable == null) return false;
// get diameter value
object cableDiameter = cablesTable.GetRow(cablesFeature.OID).get_Value(1);
if (cableDiameter.ToString() != "8") return false; //if not 8 do nothing
schemAssociatedLink = enumLink.Next();
}
return true; // if this far
}
示例3: FindMyRule
// Find and return this rule from the passed in objects
private NodeReductionRule FindMyRule(ESRI.ArcGIS.esriSystem.ISet Objectset)
{
if (Objectset.Count == 0)
return null;
Objectset.Reset();
object obj;
obj = Objectset.Next();
while (obj != null)
{
if (obj is CustomRulesCS.NodeReductionRule)
{
break;
}
obj = Objectset.Next();
}
return (NodeReductionRule)obj;
}
示例4: SetObjects
public void SetObjects(ESRI.ArcGIS.esriSystem.ISet objects)
{
// supplies the page with the object(s) to be edited including the map, feature layer,
// feature class, and renderer
// note: the feature renderer passed in as part of Objects is the one created
// in CreateCompatibleObject
object pObj = null;
if (objects.Count <= 0)
return;
objects.Reset();
pObj = objects.Next();
IMap pMap = null;
IGeoFeatureLayer pGeoLayer = null;
// in this implementation we need info from the map and the renderer
while (pObj != null)
{
if (pObj is IMap)
pMap = pObj as IMap;
if (pObj is IGeoFeatureLayer)
pGeoLayer = pObj as IGeoFeatureLayer;
if (pObj is IFeatureRenderer)
m_pRend = pObj as IFeatureRenderer;
pObj = objects.Next();
}
if ((pMap != null) & (pGeoLayer != null) & (m_pRend != null))
{
m_Page.InitControls(m_pRend as IMultivariateRenderer, pMap, pGeoLayer);
}
}
示例5: Applies
public bool Applies(ESRI.ArcGIS.esriSystem.ISet objects)
{
object pObj = null;
if (objects.Count <= 0)
{
return false;
return false;
}
objects.Reset();
pObj = objects.Next();
while (! (pObj is IFeatureRenderer))
{
pObj = objects.Next();
if (pObj == null)
{
return false;
return false;
}
}
return (pObj is IMultivariateRenderer);
}
示例6: SetObjects
/// <summary>
/// Set the necessary objects required for the form. In this case
/// the form is given an arguments object in edit mode, or is required
/// to create one in create mode. After getting or creating the arguments
/// object, template mode is checked for and handled. The template mode
/// requires all parameters of the arguments object to converted to variables.
/// </summary>
/// <param name="objects">Set of objects required for the form.</param>
public void SetObjects(ESRI.ArcGIS.esriSystem.ISet objects)
{
try
{
// Recurse through the objects
objects.Reset();
for (int i = 0; i < objects.Count; i++)
{
object currObject = objects.Next();
// Find the properties to be set.
if (currObject is IPropertySet)
{
IPropertySet uiParameters = (IPropertySet)currObject;
object names, values;
uiParameters.GetAllProperties(out names, out values);
bool disableForm = false;
try { disableForm = Convert.ToBoolean(uiParameters.GetProperty("RFxPropPageIsReadOnly")); }
catch (Exception) { }
if (disableForm)
isFormReadOnly = true;
else
isFormReadOnly = false;
// Check if the arguments object exists in the property set.
object functionArgument = null;
try { functionArgument = uiParameters.GetProperty("RFxArgument"); }
catch (Exception) { }
// If not, the form is in create mode.
if (functionArgument == null)
{
#region Create Mode
// Create a new arguments object.
myArgs = new NDVICustomFunctionArguments();
// Create a new property and set the arguments object on it.
uiParameters.SetProperty("RFxArgument", myArgs);
// Check if a default raster is supplied.
object defaultRaster = null;
try { defaultRaster = uiParameters.GetProperty("RFxDefaultInputRaster"); }
catch (Exception) { }
if (defaultRaster != null) // If it is, set it to the raster property.
myArgs.Raster = defaultRaster;
// Check if the form is in template mode.
templateMode = (bool)uiParameters.GetProperty("RFxTemplateEditMode");
if (templateMode)
{
// Since we are in create mode already, new variables have to be
// created for each property of the arguments object.
#region Create Variables
if (defaultRaster != null)
{
// If a default raster is supplied and it is a variable,
// there is no need to create one.
if (defaultRaster is IRasterFunctionVariable)
myRasterVar = (IRasterFunctionVariable)defaultRaster;
else
{
// Create variable object for the InputRaster property.
myRasterVar = new RasterFunctionVariableClass();
myRasterVar.Value = defaultRaster;
myRasterVar.Name = "InputRaster";
myRasterVar.IsDataset = true;
}
}
// Create a variable for the BandIndices property.
myBandIndicesVar = new RasterFunctionVariableClass();
myBandIndicesVar.Name = "BandIndices";
// Use the default value from the arguments object
myBandIndicesVar.Value = myArgs.BandIndices;
// Set the variables created as properties on the arguments object.
IRasterFunctionArguments rasterFunctionArgs =
(IRasterFunctionArguments)myArgs;
rasterFunctionArgs.PutValue("Raster", myRasterVar);
rasterFunctionArgs.PutValue("BandIndices", myBandIndicesVar);
#endregion
}
#endregion
}
else
{
#region Edit Mode
// Get the arguments object from the property set.
myArgs = (INDVICustomFunctionArguments)functionArgument;
// Check if the form is in template mode.
templateMode = (bool)uiParameters.GetProperty("RFxTemplateEditMode");
if (templateMode)
{
#region Edit Template
// In template edit mode, the variables from the arguments object
//.........这里部分代码省略.........
示例7: Applies
/// <summary>
/// Check if the form is applicable to the given set of objects. In this case
/// only the Raster Function object is used to check compatibility.
/// </summary>
/// <param name="objects">Set of object to check against.</param>
/// <returns>Flag to specify whether the form is applicable.</returns>
public bool Applies(ESRI.ArcGIS.esriSystem.ISet objects)
{
objects.Reset();
for (int i = 0; i < objects.Count; i++)
{
object currObject = objects.Next();
if (currObject is IRasterFunction)
{
IRasterFunction rasterFunction = (IRasterFunction)currObject;
if (rasterFunction is IPersistVariant)
{
IPersistVariant myVariantObject = (IPersistVariant)rasterFunction;
// Compare the ID from the function object with the ID's supported by this UI page.
if (myVariantObject.ID.Compare(mySupportedID))
return true;
else
return false;
}
else
return false;
}
}
return false;
}
示例8: SelectElementsToCollapse
public ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeature SelectElementsToCollapse(ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureNode node, ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeature relatedFeatures)
{
// get feature
ESRI.ArcGIS.Geodatabase.IFeature esriFeature;
esriFeature = node as ESRI.ArcGIS.Geodatabase.IFeature;
if (esriFeature == null) return null;
// get feature class
ESRI.ArcGIS.Geodatabase.IFeatureClass esriFeatureClass;
esriFeatureClass = esriFeature.Class as ESRI.ArcGIS.Geodatabase.IFeatureClass;
// if not the right feature class do nothing
if (esriFeatureClass.AliasName != "plants") return null;
bool okToCollapse = true;
relatedFeatures.Reset();
// Test if you want to collapse related element
//ESRI.ArcGIS.Schematic.ISchematicElement schemElement = relatedElements.Next();
//while ((schemElement != null) && okToCollapse)
//{
// okToCollapse = CanCollapseElement(schemElement);
// schemElement = relatedElements.Next();
//}
if (!okToCollapse)
return null; // if nothing to collapse return nothing
else if (relatedFeatures.Count == 0)
{
EnumCollapsedElts enumCollapse = new EnumCollapsedElts(); // create a list of feature to collapse
// get incident links
ESRI.ArcGIS.Schematic.IEnumSchematicInMemoryFeatureLink enumLinks;
enumLinks = node.GetIncidentLinks(ESRI.ArcGIS.Schematic.esriSchematicEndPointType.esriSchematicOriginOrExtremityNode);
if (enumLinks == null) return enumCollapse;
if (enumLinks.Count > 1)
{
enumLinks.Reset();
ESRI.ArcGIS.Schematic.ISchematicInMemoryFeatureLink schemLink;
// for each link
schemLink = enumLinks.Next();
if (schemLink != null)
{
enumCollapse.Add((ESRI.ArcGIS.Schematic.ISchematicInMemoryFeature)node); // Add node to collapse
while (schemLink != null)
{
enumCollapse.Add((ESRI.ArcGIS.Schematic.ISchematicInMemoryFeature)schemLink); // Add link to collapse
schemLink = enumLinks.Next();
}
}
}
return enumCollapse;
}
else
{
return relatedFeatures;
}
}
示例9: if
/// <summary>
/// Supplies the page with the object(s) to be edited
/// </summary>
void IComPropertyPage.SetObjects(ESRI.ArcGIS.esriSystem.ISet objects)
{
if (objects == null || objects.Count == 0)
return;
m_activeView = null;
m_targetLayer = null;
objects.Reset();
object testObject;
while ((testObject = objects.Next()) != null)
{
if (testObject is ILayer)
m_targetLayer = testObject as ILayer;
else if (testObject is IActiveView)
m_activeView = testObject as IActiveView;
//else
//{
//IApplication app = testObject as IApplication //Use if needed
//}
}
}
示例10: while
/// <summary>
/// Indicates if the page applies to the specified objects
/// Do not hold on to the objects here.
/// </summary>
bool IComPropertyPage.Applies(ESRI.ArcGIS.esriSystem.ISet objects)
{
if (objects == null || objects.Count == 0)
return false;
bool isEditable = false;
objects.Reset();
object testObject;
while ((testObject = objects.Next()) != null)
{
if (testObject is ILayer)
{
isEditable = true;
break;
}
}
return isEditable;
}
示例11: HasChildren
public bool HasChildren(string parentDir, ESRI.ArcGIS.esriSystem.IFileNames fileNames)
{
if (fileNames != null)
{
fileNames.Reset();
string fileName = fileNames.Next();
while ((fileName != null) & (fileName.Length > 0))
{
if (fileName.ToUpper().EndsWith(".PY"))
return true;
fileName = fileNames.Next();
}
}
return false;
}
示例12: GetChildren
public ESRI.ArcGIS.Catalog.IEnumGxObject GetChildren(string parentDir, ESRI.ArcGIS.esriSystem.IFileNames fileNames)
{
IGxObjectArray gxChildren = new GxObjectArray();
if (fileNames != null)
{
fileNames.Reset();
string fileName = fileNames.Next();
while (fileName != null)
{
if (fileName.Length > 0)
{
if (!(fileNames.IsDirectory()))
{
if (fileName.ToUpper().EndsWith(".PY"))
{
GxPyObject gxChild = new GxPyObject(fileName);
gxChildren.Insert(-1, gxChild);
gxChild = null;
// Remove file name from the list for other GxObjectFactories to search.
fileNames.Remove();
}
}
}
fileName = fileNames.Next();
}
}
if (gxChildren.Count > 0)
{
IEnumGxObject enumChildren = (IEnumGxObject)gxChildren;
enumChildren.Reset();
return enumChildren;
}
else
return null;
}
示例13: FindMyRule
// Find and return this rule from the passed in objects
private BisectorRule FindMyRule(ESRI.ArcGIS.esriSystem.ISet Objectset)
{
if (Objectset.Count == 0)
return null;
Objectset.Reset();
object obj;
obj = Objectset.Next();
while (obj != null)
{
if (obj is BisectorRule)
{
break;
}
obj = Objectset.Next();
}
return (BisectorRule)obj;
}
示例14: 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;
}
示例15: while
/// <summary>
/// Supplies the page with the object(s) to be edited
/// </summary>
void IComPropertyPage.SetObjects(ESRI.ArcGIS.esriSystem.ISet objects)
{
if (objects == null || objects.Count == 0)
return;
//Prepare to hold on to editable objects
if (m_objectBag == null)
m_objectBag = new Dictionary<string, object>();
else
m_objectBag.Clear();
objects.Reset();
object testObject;
while ((testObject = objects.Next()) != null)
{
if (testObject != null)
{
m_editor = testObject as IEditor;
break;
}
}
if (m_editor != null)
{
IExtensionManager extensionManager = m_editor as IExtensionManager;
//for (int index = 0; index < extensionManager.ExtensionCount; index++)
//{
// System.Diagnostics.Debug.WriteLine(extensionManager.Extension[index].Name);
//}
UID osmEditorExtensionCLSID = new UIDClass();
osmEditorExtensionCLSID.Value = "{faa799f0-bdc7-4ca4-af0c-a8d591c22058}";
OSMEditorExtension osmEditorExtension = m_editor.Parent.FindExtensionByCLSID(osmEditorExtensionCLSID) as OSMEditorExtension;
if (osmEditorExtension != null)
{
m_osmbaseURL = osmEditorExtension.OSMBaseURL;
}
}
}