예제 #1
0
        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);
        }
예제 #2
0
        static void Main()
        {
            var controller = new MainController();

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            controller.Run();
        }
예제 #3
0
        public NewBookWizard(MainController owner)
        {
            this.owner = owner;

            this.InitializeComponent();

            this.LoadCurrencies();
            this.SetDefaultCurrency();
            this.LoadDefaultAccounts();
        }
예제 #4
0
        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());
        }