Пример #1
0
        private void clearAgents_Click(object sender, EventArgs e)
        {
            snapEnvironment.ClearSnapAgents();

            //refresh this window
            RefreshDisplay();
        }
Пример #2
0
        public void RefreshSnapAgent(List <SnapAgent> pSnapAgents, bool pSnapTip)
        {
            IEngineSnapEnvironment environment = this._editor as IEngineSnapEnvironment;

            environment.ClearSnapAgents();
            this._snapLayers.Clear();
            foreach (SnapAgent agent in pSnapAgents)
            {
                try
                {
                    esriGeometryHitPartType esriGeometryPartNone = esriGeometryHitPartType.esriGeometryPartNone;
                    if (agent.Vertex)
                    {
                        esriGeometryPartNone ^= esriGeometryHitPartType.esriGeometryPartVertex;
                    }
                    if (agent.Edge)
                    {
                        esriGeometryPartNone ^= esriGeometryHitPartType.esriGeometryPartBoundary;
                    }
                    if (agent.EndPoint)
                    {
                        esriGeometryPartNone ^= esriGeometryHitPartType.esriGeometryPartEndpoint;
                    }
                    if (esriGeometryPartNone != esriGeometryHitPartType.esriGeometryPartNone)
                    {
                        IEngineFeatureSnapAgent snapAgent = new EngineFeatureSnapClass
                        {
                            FeatureClass = agent.FeatureLayer.FeatureClass,
                            HitType      = esriGeometryPartNone
                        };
                        environment.AddSnapAgent(snapAgent);
                        this._snapLayers.Add(agent.FeatureLayer);
                    }
                }
                catch
                {
                }
            }
            ((IEngineEditProperties2)this._editor).SnapTips = pSnapTip;
        }