public object Clone() { var clone = new FinancialGoal(Value, Name); clone.AllocatedFunds = AllocatedFunds; clone.TimeToDeadline = TimeToDeadline; return(clone); }
//returns false if item not found public bool RemoveFinancialGoal(FinancialGoal goal) { return(FinancialGoals.Remove(goal)); }
public void AddFinancialGoal(FinancialGoal goal) { FinancialGoals.Add(goal); }
public static void AddGoalVisuals(Int32 type, String name, String goal, Int32 locationX, Int32 locationY, Form currentForm, Button btnAddGoal, int measurements) { int btnLocationX = btnAddGoal.Location.X; Int32 startX = btnLocationX; Int32 startY = 150; int locX = startX + locationX; int locY = startY + locationY; //ICON IconPictureBox icon = new IconPictureBox { BackColor = Color.FromArgb(((int)(((byte)(34)))), ((int)(((byte)(33)))), ((int)(((byte)(74))))), ForeColor = Color.Gainsboro, IconChar = FontAwesome.Sharp.IconChar.FolderMinus, IconColor = Color.Gainsboro, Location = new Point(locX, locY - 5), Margin = new Padding(3, 2, 3, 2), Name = "iconGoal", Size = new Size(40, 32), }; //GOAL NAME Double goalConverted = Convert.ToDouble(goal); Label goalName = new Label { Location = new Point(locX + 50, locY), Text = name, AutoSize = true, ForeColor = Color.Gainsboro, Font = new Font("Segoe UI", 10.2F, FontStyle.Bold) }; //SLIDER TrackBar trackBarGoal = new TrackBar { Location = new Point(locX + 110, locY - 5), Margin = new Padding(3, 2, 3, 2), Maximum = Convert.ToInt32(goalConverted * 1.2), Value = Convert.ToInt32(goalConverted), Name = "trackBarGoal", Size = new Size(155, 55), TabIndex = 2, TickStyle = TickStyle.None }; //LABEL PRICE Label goalPrice = new Label { Location = new Point(locX + 270, locY), Text = (goalConverted).ToString("€#.#"), AutoSize = true, Font = new Font("Segoe UI", 10.2F, FontStyle.Bold), ForeColor = Color.Gainsboro }; //LABEL ESTIMATED TIME Label estimatedTime = new Label { Location = new Point(locX + 340, locY), Text = FinancialGoal.GetEstimatedTime(FinancialPlanController.ActivePlan.Savings, goalConverted, measurements), AutoSize = true, Font = new Font("Segoe UI", 10.2F, FontStyle.Bold), ForeColor = Color.Gainsboro }; currentForm.Controls.Add(icon); currentForm.Controls.Add(goalName); currentForm.Controls.Add(trackBarGoal); currentForm.Controls.Add(goalPrice); currentForm.Controls.Add(estimatedTime); }