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


C# IObject.Store方法代码示例

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


在下文中一共展示了IObject.Store方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: m_editEvents_OnChangeFeature


//.........这里部分代码省略.........
                if (((IFeatureChanges)currentFeature).ShapeChanged == true)
                {
                    int memberOFFieldIndex = currentFeature.Fields.FindField("osmMemberOf");
                    int membersFieldIndex = currentFeature.Fields.FindField("osmMembers");
                    int osmIDFieldIndex = currentFeature.Fields.FindField("OSMID");

                    long osmID = 0;

                    if (osmIDFieldIndex > -1)
                    {
                        object osmIDValue = currentFeature.get_Value(osmIDFieldIndex);

                        if (osmIDValue != DBNull.Value)
                        {
                            osmID = Convert.ToInt64(osmIDValue);
                        }
                    }

                    if (membersFieldIndex > -1)
                    {
                        ESRI.ArcGIS.OSM.OSMClassExtension.member[] relationMembers = _osmUtility.retrieveMembers(currentFeature, membersFieldIndex);

                        if (relationMembers != null)
                        {
                            if (relationMembers.Length > 0)
                            {
                                string abortMessage = String.Format(resourceManager.GetString("OSMEditor_FeatureInspector_multipartchangeparentconflictmessage"), osmID);
                                MessageBox.Show(abortMessage, resourceManager.GetString("OSMEditor_FeatureInspector_relationconflictcaption"), MessageBoxButtons.OK, MessageBoxIcon.Stop);
                                m_editor3.AbortOperation();
                            }
                        }
                    }

                    if (memberOFFieldIndex > -1)
                    {
                        List<string> isMemberOfList = _osmUtility.retrieveIsMemberOf(currentFeature, memberOFFieldIndex);
                        Dictionary<string, string> dictofParentsAndTypes = _osmUtility.parseIsMemberOfList(isMemberOfList);

                        StringBuilder typeAndIDString = new StringBuilder();
                        foreach (var item in dictofParentsAndTypes)
                        {
                            switch (item.Value)
                            {
                                case "rel":
                                    typeAndIDString.Append(resourceManager.GetString("OSMEditor_FeatureInspector_relationidtext") + item.Key + ",");
                                    break;
                                case "ply":
                                    typeAndIDString.Append(resourceManager.GetString("OSMEditor_FeatureInspector_polygonidtext") + item.Key + ",");
                                    break;
                                case "ln":
                                    typeAndIDString.Append(resourceManager.GetString("OSMEditor_FeatureInspector_polylineidtext") + item.Key + ",");
                                    break;
                                case "pt":
                                    typeAndIDString.Append(resourceManager.GetString("OSMEditor_FeatureInspector_pointidtext") + item.Key + ",");
                                    break;
                                default:
                                    break;
                            }
                        }

                        if (typeAndIDString.Length > 0)
                        {
                            string parentsString = typeAndIDString.ToString(0, typeAndIDString.Length - 1);
                            string abortMessage = String.Format(resourceManager.GetString("OSMEditor_FeatureInspector_multipartchangeconflictmessage"), osmID, parentsString);
                            MessageBox.Show(abortMessage, resourceManager.GetString("OSMEditor_FeatureInspector_relationconflictcaption"), MessageBoxButtons.OK, MessageBoxIcon.Stop);
                            m_editor3.AbortOperation();
                        }
                    }
                }
            }

            ISegmentCollection segmentCollection = currentFeature.Shape as ISegmentCollection;
            bool densifyRequired = false;

            for (int segmentIndex = 0; segmentIndex < segmentCollection.SegmentCount; segmentIndex++)
            {
                ISegment segment = segmentCollection.get_Segment(segmentIndex);

                if (!(segment is Line))
                {
                    densifyRequired = true;
                    break;
                }
            }

            if (densifyRequired)
            {
                IGeometryEnvironment4 geometryEnvironment = new GeometryEnvironmentClass() as IGeometryEnvironment4;

                double densifyTolerance = geometryEnvironment.AutoDensifyTolerance;
                double deviationTolerance = geometryEnvironment.DeviationAutoDensifyTolerance;

                IPolycurve polycurve = currentFeature.Shape as IPolycurve;
                polycurve.Densify(densifyTolerance, deviationTolerance);

                currentFeature.Shape = polycurve;

                obj.Store();
            }
        }
开发者ID:weepingdog,项目名称:arcgis-osm-editor,代码行数:101,代码来源:OSMEditorExtension.cs

示例2: m_editEvents_OnCreateFeature

        void m_editEvents_OnCreateFeature(IObject obj)
        {
            // check if feature contains more than 2000 nodes/vertices
            //  applies to lines and polygons
            //  notify the user and offer a split
            // check if feature geometry is multi-part
            //  applies to lines and polygons
            //  notify the user and offer a conversion to relation

            IFeatureClass currentObjectFeatureClass = obj.Class as IFeatureClass;
            if ((currentObjectFeatureClass == null) || (currentObjectFeatureClass.EXTCLSID == null))
                return;

            // check if the current feature class being edited is acutally an OpenStreetMap feature class
            // all other feature class should not be touched by this extension
            UID osmEditorExtensionCLSID = currentObjectFeatureClass.EXTCLSID;

            if (osmEditorExtensionCLSID.Value.ToString().Equals("{65CA4847-8661-45eb-8E1E-B2985CA17C78}", StringComparison.InvariantCultureIgnoreCase) == false)
            {
                return;
            }

            IFeature currentFeature = obj as IFeature;
            if (currentFeature == null)
                return;

            ISegmentCollection segmentCollection = currentFeature.Shape as ISegmentCollection;
            bool densifyRequired = false;

            if (segmentCollection != null)
            {
                for (int segmentIndex = 0; segmentIndex < segmentCollection.SegmentCount; segmentIndex++)
                {
                    ISegment segment = segmentCollection.get_Segment(segmentIndex);

                    if (!(segment is Line))
                    {
                        densifyRequired = true;
                        break;
                    }
                }
            }

            if (densifyRequired)
            {
                IGeometryEnvironment4 geometryEnvironment = new GeometryEnvironmentClass() as IGeometryEnvironment4;

                double densifyTolerance = geometryEnvironment.AutoDensifyTolerance;
                double deviationTolerance = geometryEnvironment.DeviationAutoDensifyTolerance;

                IPolycurve polycurve = currentFeature.Shape as IPolycurve;
                polycurve.Densify(densifyTolerance, deviationTolerance);

                currentFeature.Shape = polycurve;

                obj.Store();
            }
        }
开发者ID:weepingdog,项目名称:arcgis-osm-editor,代码行数:58,代码来源:OSMEditorExtension.cs

示例3: SetDynamicValues


//.........这里部分代码省略.........
                                                            }
                                                        }
                                                        if (valueChanged == false)
                                                        {
                                                            AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorChain24"));
                                                            continue;
                                                        }

                                                        string[] sourceFieldNames = null;

                                                        // Parse arguments
                                                        args = valData.Split('|');
                                                        if (args.Length == 1)
                                                        {

                                                            sourceFieldNames = args[0].ToString().Split(',');

                                                        }

                                                        else
                                                        {
                                                            AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorError_14a") + A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorError_14d"));
                                                            continue;

                                                        }

                                                        if ((sourceFieldNames != null) &&
                                                            (sourceFieldNames.Length > 0))
                                                        {
                                                            int flx = inObject.Fields.FindField(sourceFieldNames[0]);
                                                            if (flx > 0)
                                                            {
                                                                inObject.set_Value(flx, pRowCh.get_OriginalValue(intFldIdxs[0]));
                                                                inObject.Store();

                                                            }
                                                        }
                                                        else
                                                        {

                                                            AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorError_14a") + A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorError_14e") + valData);
                                                        }
                                                    }
                                                    else
                                                    {
                                                        AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorError_14a") + A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorError_14f"));
                                                    }
                                                }
                                                catch (Exception ex)
                                                {
                                                    AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorError_14a") + "PREVIOUS_VALUE" + Environment.NewLine + ex.Message);
                                                }

                                                finally
                                                {

                                                    pRowCh = null;
                                                    AAState.WriteLine(A4LGSharedFunctions.Localizer.GetString("AttributeAssistantEditorMess_14as") + "PREVIOUS_VALUE");
                                                }
                                                break;
                                            }

                                        case "ANGLE":

                                            try
                                            {
开发者ID:rlwarford,项目名称:local-government-desktop-addins,代码行数:67,代码来源:AttributeAssistantEditorExtension.cs


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