public static void AddLine(Project aProject, int aStart, int aEnd) { if (aStart != aEnd) { AddRollback(aProject); aProject.AddLine(aStart, aEnd); } }
public static void RemoveLine(Project aProject, int aIndex) { if (aIndex != -1) { AddRollback(aProject); aProject.RemoveLine(aIndex); } }
public static void Redo(Project aProject) { if (mRedoStack.Count > 0) { mUndoStack.Push(new GenericRollback(aProject)); mRedoStack.Pop().Undo(); } }
public ProjectSettings(Project aProject) { InitializeComponent(); mDistanceTolerance.Value = aProject.DistanceTolerance; mAngleTolerance.Value = aProject.AngleTolerance; mDeg45.Checked = aProject.FlightZoneMode == FlightZone.Deg45; mDeg90.Checked = aProject.FlightZoneMode == FlightZone.Deg90; mDegBoth.Checked = aProject.FlightZoneMode == FlightZone.Both; }
public JumpInfo(Project aProject) { InitializeComponent(); mDescription.Text = aProject.Description; mDate.Value = aProject.Date; mPlace.Text = aProject.Place; mGlideRatio.Text = aProject.GlideRatio.ToString(); mJumpNumber.Value = aProject.JumpNumber; mFallrate.Value = aProject.Fallrate; }
public static void MoveMarker(Project aProject, int aIndex, PointF aOld, PointF aNew) { if (aIndex != -1) { AddRollback(aProject); Marker marker = aProject.GetMarker(aIndex); marker.Location = aNew; aProject.Dirty = true; } }
public static void MarkerToggleFlightZone(Project aProject, int aIndex) { if (aIndex != -1) { AddRollback(aProject); Marker marker = aProject.GetMarker(aIndex); marker.ShowFlightZone = !marker.ShowFlightZone; aProject.Dirty = true; } }
public AddLineAction(Project aProject) : base(aProject) { }
public RemoveLineAction(Project aProject) : base(aProject) { }
public MoveMarkerAction(Project aProject) : base(aProject) { }
public RotateAction(Project aProject) : base(aProject) { mBounds = new Bound(Project.BoundingRect); }
public TransformGridAction(Project aProject) : base(aProject) { mBounds = new GridBound(Project.GridOffset, Project.GridSize); }
private void OnOpenClick(object sender, EventArgs e) { if (IsItSaveToDestroyProject()) { OpenFileDialog dialog = new OpenFileDialog(); dialog.Title = "Open project"; dialog.Filter = "Flock files (*.flock)|*.flock"; dialog.CheckFileExists = true; dialog.CheckPathExists = true; dialog.ShowHelp = true; if (dialog.ShowDialog(this) == DialogResult.OK) { try { Project = new Project(dialog.FileName); ProjectName = dialog.FileName; SaveSettings(); OnCenterImageClick(sender, e); if (!string.IsNullOrEmpty(Project.PhotoName)) { if (File.Exists(Project.PhotoName)) { mPictureBox.LoadImage(Project.PhotoName); } else { string photoName = Path.Combine(Path.GetDirectoryName(dialog.FileName), Path.GetFileName(Project.PhotoName)); if (File.Exists(photoName)) { mPictureBox.LoadImage(photoName); } else { string message = string.Format("The photo [{0}] associated with this project could not be found.", Path.GetFileName(Project.PhotoName)); MessageBox.Show(this, message, "Error loading associated photo.", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } } catch (Exception ex) { ResetProject(); MessageBox.Show(this, ex.Message, "Error loading project", MessageBoxButtons.OK, MessageBoxIcon.Error); } } } }
private void ResetProject() { SaveSettings(); Project = new Project(); ProjectName = null; mPictureBox.ResetImage(); SyncUI(); }
public static void RemoveMarker(Project aProject, int aIndex) { AddRollback(aProject); aProject.RemoveMarker(aIndex); }
public AddMarkerAction(Project aProject) : base(aProject) { }
public static void AddRollback(Project aProject) { mRedoStack.Clear(); mUndoStack.Push(new GenericRollback(aProject)); }
public static void AddMarker(Project aProject, float aX, float aY) { AddRollback(aProject); aProject.AddMarker(new Marker(aX, aY)); }
protected Action(Project aProject) { mProject = aProject; }
public GenericRollback(Project aProject) { mProject = aProject; using (MemoryStream stream = new MemoryStream()) { mProject.Serialize(stream); mMemory = stream.ToArray(); } }