Core.SnapEditor.reverseAgentsPriority_Click C# (CSharp) Method

reverseAgentsPriority_Click() private method

private reverseAgentsPriority_Click ( object sender, EventArgs e ) : void
sender object
e System.EventArgs
return void
    private void reverseAgentsPriority_Click(object sender, EventArgs e)
    {
      //get all the snap agents in reverse order and then deactivate them
      ArrayList snapAgentList = new ArrayList();

      for (int i = snapEnvironment.SnapAgentCount - 1; i >= 0; i--)
      {
        IEngineSnapAgent tmpAgent = snapEnvironment.get_SnapAgent(i);
        snapAgentList.Add(tmpAgent);
        snapEnvironment.RemoveSnapAgent(i);
      }

      //add the agents back to the environment
      foreach (IEngineSnapAgent agent in snapAgentList)
      {
        snapEnvironment.AddSnapAgent(agent);
      }

      //refresh this window
      RefreshDisplay();
    }