public EditAccountView(MainController owner, Account account) { if (owner == null) { throw new ArgumentNullException("owner"); } if (account == null) { throw new ArgumentNullException("account"); } this.owner = owner; this.originalAccount = account; InitializeComponent(); this.securityComboBox.Items.Add(new SecurityOption(null)); this.securityComboBox.Items.AddRange(this.owner.Book.Securities.Select(s => new SecurityOption(s)).ToArray()); this.nameTextBox.Text = this.originalAccount.Name; this.balanceAccountRadio.Checked = this.originalAccount.AccountType == AccountType.Balance; this.groupingAccountRadio.Checked = this.originalAccount.AccountType == AccountType.Grouping; this.securityComboBox.SelectedItem = this.securityComboBox.Items.Cast<SecurityOption>().Where(so => so.Security == this.originalAccount.Security).Single(); this.fractionTextBox.Text = this.originalAccount.Security == null ? string.Empty : this.originalAccount.Security.FormatValue(this.originalAccount.Security.FractionTraded / this.originalAccount.SmallestFraction.Value); }
static void Main() { var controller = new MainController(); Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); controller.Run(); }
public NewBookWizard(MainController owner) { this.owner = owner; this.InitializeComponent(); this.LoadCurrencies(); this.SetDefaultCurrency(); this.LoadDefaultAccounts(); }
public MainView(MainController owner) { this.owner = owner; this.owner.BookChanged += Owner_BookChanged; this.owner.ActiveAccountChanged += Owner_ActiveAccountChanged; this.InitializeComponent(); this.Owner_BookChanged(this.owner, new EventArgs()); this.Owner_ActiveAccountChanged(this.owner, new EventArgs()); }