コード例 #1
0
        public static bool CanAdjust(DataAccessLayer dal)
        {
            foreach (TtPolygon poly in dal.GetPolygons())
            {
                if (dal.GetPointCount(poly.CN) > 0)
                {
                    TtPoint p = dal.GetFirstPointInPolygon(poly.CN);
                    if (p != null)
                    {
                        if (p.IsTravType())
                        {
                            System.Windows.Forms.MessageBox.Show(String.Format("Polygon {0} can not start with a {1}. Point {2} must derive from a GPS type or Quondam.",
                                poly.Name, p.op.ToString(), p.PID), "Bad Polygon Start");
                            return false;
                        }
                        /*
                        else if (p.op == OpType.Quondam)
                        {
                            if (((QuondamPoint)p).ParentOp == OpType.Traverse)
                            {
                                System.Windows.Forms.MessageBox.Show(String.Format("Polygon {0} can not start with a Quondam to a Traverse. Point {2} must derive from a GPS type.",
                                    poly.Name, p.op.ToString(), p.PID), "Bad Polygon Start");
                                return false;
                            }
                        }
                        */
                    }
                    else
                    {
                        //no point
                        return false;
                    }
                }
            }

            return true;
        }