private void SetRegionPropsMouseHandler(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         if (srpMode == SetRegionPropsMode.Normal)
         {
             mapPanel.SelectCurRegion(e.X, e.Y);
         }
         else if (srpMode == SetRegionPropsMode.SetLeftRegion)
         {
             if (mapPanel.SetLeftRegion(e.X, e.Y))
             {
                 srpMode = SetRegionPropsMode.Normal;
                 mapPanel.PaintRouteArrow = false;
             }
         }
         else if (srpMode == SetRegionPropsMode.SetRightRegion)
         {
             if (mapPanel.SetRightRegion(e.X, e.Y))
             {
                 srpMode = SetRegionPropsMode.Normal;
                 mapPanel.PaintRouteArrow = false;
             }
         }
         else if (srpMode == SetRegionPropsMode.SetUpRegion)
         {
             if (mapPanel.SetUpRegion(e.X, e.Y))
             {
                 srpMode = SetRegionPropsMode.Normal;
                 mapPanel.PaintRouteArrow = false;
             }
         }
         else if (srpMode == SetRegionPropsMode.SetDownRegion)
         {
             if (mapPanel.SetDownRegion(e.X, e.Y))
             {
                 srpMode = SetRegionPropsMode.Normal;
                 mapPanel.PaintRouteArrow = false;
             }
         }
     }
     else if (e.Button == MouseButtons.Right)
     {
         if (srpMode == SetRegionPropsMode.Normal)
         {
             if (mapPanel.InMapViewRegion(e.X, e.Y) && mapPanel.CanSetRegionProps(e.X, e.Y))
             {
                 ResetSetRegionPropsMenu();
                 cmSetRegionProps.Show(this.Location.X + mapPanel.Location.X + e.X,
                                       this.Location.Y + mapPanel.Location.Y + e.Y);
             }
         }
         else
         {
             srpMode = SetRegionPropsMode.Normal;
             mapPanel.PaintRouteArrow = false;
         }
     }
 }
 private void miSetRightRegion_Click(object sender, EventArgs e)
 {
     if (operateMode == OperateMode.SetRegionProps && srpMode == SetRegionPropsMode.Normal)
     {
         srpMode = SetRegionPropsMode.SetRightRegion;
         mapPanel.PaintRouteArrow = true;
     }
 }
 private void SetRegionPropsMouseHandler(object sender, MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         if (srpMode == SetRegionPropsMode.Normal)
         {
             mapPanel.SelectCurRegion(e.X, e.Y);
         }
         else if (srpMode == SetRegionPropsMode.SetLeftRegion)
         {
             if (mapPanel.SetLeftRegion(e.X, e.Y))
             {
                 srpMode = SetRegionPropsMode.Normal;
                 mapPanel.PaintRouteArrow = false;
             }
         }
         else if (srpMode == SetRegionPropsMode.SetRightRegion)
         {
             if (mapPanel.SetRightRegion(e.X, e.Y))
             {
                 srpMode = SetRegionPropsMode.Normal;
                 mapPanel.PaintRouteArrow = false;
             }
         }
         else if (srpMode == SetRegionPropsMode.SetUpRegion)
         {
             if (mapPanel.SetUpRegion(e.X, e.Y))
             {
                 srpMode = SetRegionPropsMode.Normal;
                 mapPanel.PaintRouteArrow = false;
             }
         }
         else if (srpMode == SetRegionPropsMode.SetDownRegion)
         {
             if (mapPanel.SetDownRegion(e.X, e.Y))
             {
                 srpMode = SetRegionPropsMode.Normal;
                 mapPanel.PaintRouteArrow = false;
             }
         }
     }
     else if (e.Button == MouseButtons.Right)
     {
         if (srpMode == SetRegionPropsMode.Normal)
         {
             if (mapPanel.InMapViewRegion(e.X, e.Y) && mapPanel.CanSetRegionProps(e.X, e.Y))
             {
                 ResetSetRegionPropsMenu();
                 cmSetRegionProps.Show(this.Location.X + mapPanel.Location.X + e.X,
                         this.Location.Y + mapPanel.Location.Y + e.Y);
             }
         }
         else
         {
             srpMode = SetRegionPropsMode.Normal;
             mapPanel.PaintRouteArrow = false;
         }
     }
 }
 private void miSetUpRegion_Click(object sender, EventArgs e)
 {
     if (operateMode == OperateMode.SetRegionProps && srpMode == SetRegionPropsMode.Normal)
     {
         srpMode = SetRegionPropsMode.SetUpRegion;
         mapPanel.PaintRouteArrow = true;
     }
 }