当前位置: 首页>>代码示例>>C#>>正文


C# ESRI.Next方法代码示例

本文整理汇总了C#中ESRI.Next方法的典型用法代码示例。如果您正苦于以下问题:C# ESRI.Next方法的具体用法?C# ESRI.Next怎么用?C# ESRI.Next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ESRI的用法示例。


在下文中一共展示了ESRI.Next方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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();
			}
		}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:15,代码来源:EnumCollapsedElts.cs

示例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
		}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:45,代码来源:PlantOnCableDiameter.cs

示例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;
        }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:23,代码来源:NodeReductionRulePropertyPage.cs

示例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);
			}

		}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:35,代码来源:MultivariateRendPropPage.cs

示例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);

		}
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:26,代码来源:MultivariateRendPropPage.cs

示例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
//.........这里部分代码省略.........
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:101,代码来源:NDVICustomFunctionUIClass.cs

示例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;
 }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:30,代码来源:NDVICustomFunctionUIClass.cs

示例8: 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;

            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
                //}
            }
        }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:25,代码来源:LayerVisibilityPage.cs

示例9: 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;
 }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:15,代码来源:GxPyFactory.cs

示例10: 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;
        }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:39,代码来源:GxPyFactory.cs

示例11: 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;
        }
开发者ID:Esri,项目名称:arcobjects-sdk-community-samples,代码行数:23,代码来源:BisectorRulePropertyPage.cs

示例12: 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;
                }
            }
        }
开发者ID:weepingdog,项目名称:arcgis-osm-editor,代码行数:44,代码来源:OSMEditorPropertyPage.cs


注:本文中的ESRI.Next方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。