Example #1
0
        public Form(ISettings settings, IRecordsStorage aggregator, IAdder adder, IAmountFactory factory)
        {
            this.settings   = settings;
            this.aggregator = aggregator;
            this.adder      = adder;
            this.factory    = factory;

            amount = factory.Create(selectedType);
            Types  = Enum.GetValues(typeof(Types)).Cast <Types>();
            UpdateCategories(selectedType);

            DateTime     = DateTime.Now;
            Descriptions = settings.Descriptions;
        }
Example #2
0
        private static Form CreateForm()
        {
            settings = For <ISettings>();
            storage  = For <IRecordsStorage>();

            settings.CategoriesMapping = new Dictionary <Types, Categories[]>
            {
                [Expense] = new[] { Food, Health, House, General, Women, Other },
                [Debt]    = new[] { Maxim, Andrey },
                [Income]  = new[] { Deposit, ODesk },
                [Shared]  = new[] { Food, House, General, Other },
            };

            return(new Form(settings, storage, For <IAdder>(), For <IAmountFactory>()));
        }