コード例 #1
0
 public static void AddLine(Project aProject, int aStart, int aEnd)
 {
     if (aStart != aEnd)
     {
         AddRollback(aProject);
         aProject.AddLine(aStart, aEnd);
     }
 }
コード例 #2
0
 public static void RemoveLine(Project aProject, int aIndex)
 {
     if (aIndex != -1)
     {
         AddRollback(aProject);
         aProject.RemoveLine(aIndex);
     }
 }
コード例 #3
0
 public static void Redo(Project aProject)
 {
     if (mRedoStack.Count > 0)
     {
         mUndoStack.Push(new GenericRollback(aProject));
         mRedoStack.Pop().Undo();
     }
 }
コード例 #4
0
 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;
 }
コード例 #5
0
ファイル: JumpInfo.cs プロジェクト: tvandijck/WingSuitJudge
 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;
 }
コード例 #6
0
 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;
     }
 }
コード例 #7
0
 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;
     }
 }
コード例 #8
0
 public AddLineAction(Project aProject)
     : base(aProject)
 {
 }
コード例 #9
0
 public RemoveLineAction(Project aProject)
     : base(aProject)
 {
 }
コード例 #10
0
 public MoveMarkerAction(Project aProject)
     : base(aProject)
 {
 }
コード例 #11
0
 public RotateAction(Project aProject)
     : base(aProject)
 {
     mBounds = new Bound(Project.BoundingRect);
 }
コード例 #12
0
 public TransformGridAction(Project aProject)
     : base(aProject)
 {
     mBounds = new GridBound(Project.GridOffset, Project.GridSize);
 }
コード例 #13
0
ファイル: Form1.cs プロジェクト: tvandijck/WingSuitJudge
        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);
                    }
                }
            }
        }
コード例 #14
0
ファイル: Form1.cs プロジェクト: tvandijck/WingSuitJudge
 private void ResetProject()
 {
     SaveSettings();
     Project = new Project();
     ProjectName = null;
     mPictureBox.ResetImage();
     SyncUI();
 }
コード例 #15
0
 public static void RemoveMarker(Project aProject, int aIndex)
 {
     AddRollback(aProject);
     aProject.RemoveMarker(aIndex);
 }
コード例 #16
0
 public AddMarkerAction(Project aProject)
     : base(aProject)
 {
 }
コード例 #17
0
 public static void AddRollback(Project aProject)
 {
     mRedoStack.Clear();
     mUndoStack.Push(new GenericRollback(aProject));
 }
コード例 #18
0
 public static void AddMarker(Project aProject, float aX, float aY)
 {
     AddRollback(aProject);
     aProject.AddMarker(new Marker(aX, aY));
 }
コード例 #19
0
ファイル: Action.cs プロジェクト: tvandijck/WingSuitJudge
 protected Action(Project aProject)
 {
     mProject = aProject;
 }
コード例 #20
0
 public GenericRollback(Project aProject)
 {
     mProject = aProject;
     using (MemoryStream stream = new MemoryStream())
     {
         mProject.Serialize(stream);
         mMemory = stream.ToArray();
     }
 }