Exemplo n.º 1
0
 public SpentInDiffDaysView(IHistoryDataProvider historyDataProvider, IMainForm mainForm)
 {
     this.historyDataProvider = historyDataProvider;
     this.mainForm = mainForm;
     InitializeComponent();
     if(historyDataProvider!=null)
         this.daySpentDataGrid.DataSource = this.historyDataProvider.Data;
 }
 public UserDataProvider(SqlDataContextcs sqlDataContextcs,
                         IHistoryDataProvider historyDataProvider,
                         IMapper mapper
                         , IOptions <AppSettings> appSettings)
 {
     this.sqlDataContextcs    = sqlDataContextcs;
     this.historyDataProvider = historyDataProvider;
     this.mapper      = mapper;
     this.appSettings = appSettings.Value;
 }
Exemplo n.º 3
0
 public SpentInDiffDaysView(IHistoryDataProvider historyDataProvider, IMainForm mainForm)
 {
     this.historyDataProvider = historyDataProvider;
     this.mainForm            = mainForm;
     InitializeComponent();
     if (historyDataProvider != null)
     {
         this.daySpentDataGrid.DataSource = this.historyDataProvider.Data;
     }
 }
Exemplo n.º 4
0
 /// <summary>
 /// Initialize all subsystems
 /// </summary>
 /// <param name="timeSystem"></param>
 /// <param name="settings"></param>
 public Driver(ITimeSystem timeSystem, ISettings settings)
 {
     //when reordering, be carefull, in order to pass only initialized objects
     this.fileManager      = new FileManager(settings);
     this.languageSwitcher = new LanguageSwitcher(settings);
     //probably all of them should be properties, not fields, in order to automatically update referencies
     TaskCollection       = LifeIdea.LazyCure.Core.Tasks.TaskCollection.Default;
     this.timeLogsManager = new TimeLogsManager(this.fileManager);
     HistoryDataProvider  = new HistoryDataProvider(timeLogsManager, TaskCollection);
     this.timeManager     = new TimeManager(timeSystem, TimeLogsManager);
     HistoryDataProvider.CreateSummaries(TimeManager.TimeLog);
     this.workingTime          = new WorkingTimeForDay(TimeManager.TimeLog, TaskCollection);
     this.efficiencyCalculator = new EfficiencyCalculator(workingTime);
     ApplySettings(settings);
 }
Exemplo n.º 5
0
        public void FromDatePopupUsingLazyCureProviderOfAvailableDates()
        {
            ILazyCureDriver lcdriver = NewMock <ILazyCureDriver>();

            Stub.On(lcdriver).GetProperty("WorkingTimeIntervalsData").Will(Return.Value(null));
            Stub.On(lcdriver).GetProperty("PossibleWorkInterruptionDuration").Will(Return.Value(TimeSpan.Zero));
            Stub.On(lcdriver).SetProperty("PossibleWorkInterruptionDuration");
            IHistoryDataProvider dataProvider = NewMock <IHistoryDataProvider>();

            Stub.On(lcdriver).GetProperty("HistoryDataProvider").Will(Return.Value(dataProvider));
            ITimeLogsManager timeLogsManager = NewMock <ITimeLogsManager>();

            Stub.On(dataProvider).GetProperty("ActivitiesSummaryData").Will(Return.Value(null));
            Stub.On(dataProvider).GetProperty("TasksSummaryData").Will(Return.Value(null));
            Stub.On(dataProvider).GetProperty("TimeLogsManager").Will(Return.Value(timeLogsManager));
            Stub.On(dataProvider).Method("SetSummaryPeriod").WithAnyArguments();
            Expect.Once.On(timeLogsManager).GetProperty("AvailableDays").Will(Return.Value(new List <DateTime>(new DateTime[] { DateTime.Parse("2000-12-31") })));

            summary = new Summary(lcdriver, null);

            VerifyAllExpectationsHaveBeenMet();
        }
Exemplo n.º 6
0
 public UserDataProvider(SqlDataContextcs sqlDataContextcs, IHistoryDataProvider historyDataProvider
Exemplo n.º 7
0
 public void SetUp()
 {
     provider = NewMock <IHistoryDataProvider>();
     Stub.On(provider).GetProperty("Data").Will(Return.Value(null));
     form = new SpentInDiffDaysView(provider, null);
 }
Exemplo n.º 8
0
 public HistoryService(IHistoryDataProvider dataProvider)
 {
     _dataProvider = dataProvider;
     DatabaseManager.RegisterDA(_dataProvider);
 }
 public void SetUp()
 {
     provider = NewMock<IHistoryDataProvider>();
     Stub.On(provider).GetProperty("Data").Will(Return.Value(null));
     form = new SpentInDiffDaysView(provider, null);
 }
Exemplo n.º 10
0
 private void UpdateSummaryDataSources(IHistoryDataProvider dataProvider)
 {
     if (dataProvider != null)
     {
         activitiesSummary.DataSource = dataProvider.ActivitiesSummaryData;
         tasksSummary.DataSource = dataProvider.TasksSummaryData;
     }
 }
 public HistoryDataProvider(IHistoryDataProvider historyDataProvider)
 {
     this.historyDataProvider = historyDataProvider;
 }