public override List <IError> Validate(List <IError> errors) { RequireString(this, x => x.PartfieldID, 14, errors, "A"); ValidateString(this, x => x.PartfieldCode, 32, errors, "B"); RequireString(this, x => x.PartfieldDesignator, 32, errors, "C"); RequireRange <ISOPartfield, uint>(this, x => x.PartfieldArea, 0, uint.MaxValue - 2, errors, "D"); ValidateString(this, x => x.CustomerIdRef, 14, errors, "E"); ValidateString(this, x => x.FarmIdRef, 14, errors, "F"); ValidateString(this, x => x.CropTypeIdRef, 14, errors, "G"); ValidateString(this, x => x.CropVarietyIdRef, 14, errors, "H"); ValidateString(this, x => x.FieldIdRef, 14, errors, "I"); if (Polygons.Count > 0) { Polygons.ForEach(i => i.Validate(errors)); } if (LineStrings.Count > 0) { LineStrings.ForEach(i => i.Validate(errors)); } if (Points.Count > 0) { Points.ForEach(i => i.Validate(errors)); } if (GuidanceGroups.Count > 0) { GuidanceGroups.ForEach(i => i.Validate(errors)); } return(errors); }
private void StartAnimation(object sender, EventArgs e) { _continueAnimation = true; LockButtons(Grafika002.Form1.ActionType.animation); animationPolygon = Polygon.RandomPolygon(_drawing); animationPolygon.FinnishDrawing(); animationPolygon.FillEnabled = true; Polygons.Add(animationPolygon); int maxRight = 0; while (_continueAnimation && maxRight < mainPictureBox.Width) { lock (this.mainPictureBox.Image) { _drawing.ClearBitmap(); Polygons.ForEach(x => x.DrawPolygon()); maxRight = animationPolygon.MoveRigth(); IntersectAllPolygonsWithAnimationPolygon(); this.mainPictureBox.Image = directBitmap.Bitmap; mainPictureBox.Update(); mainPictureBox.Refresh(); Application.DoEvents(); } } Polygons.Remove(animationPolygon); _drawing.ClearBitmap(); Polygons.ForEach(x => x.DrawPolygon()); this.mainPictureBox.Image = directBitmap.Bitmap; LockButtons(Grafika002.Form1.ActionType.animation, true); }
//------------------------------------------------------------------------------ public static void ReversePolygons(Polygons polys) { polys.ForEach(delegate(Polygon poly) { poly.Reverse(); }); }
public void Draw(GraphicsDeviceManager graphics, SpriteBatch spriteBatch, int sceneWidth) { Polygons.ForEach(p => p.Draw(graphics, spriteBatch, sceneWidth)); }