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; }
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>())); }