コード例 #1
0
 private MainViewModel PrepareMainViewModel(ClientStorage clientStorage, ProjectStorage projectStorage)
 {
     var clientListViewModel = new ClientListViewModel(clientStorage);
     var projectListViewModel = new ProjectListViewModel(projectStorage);
     var mainViewModel = new MainViewModel(clientListViewModel, projectListViewModel);
     return mainViewModel;
 }
コード例 #2
0
 public void LoadDefaultClients(ClientStorage clientStorage)
 {
     clientStorage.AddClient(new Client {Name = "Enbridge", ContactName = "Daren"});
     clientStorage.AddClient(new Client {Name = "DODO", ContactName = "Фёдор"});
     clientStorage.AddClient(new Client {Name = "Avicom", ContactName = "Евгений"});
     clientStorage.AddClient(new Client {Name = "Павел", ContactName = "Павел"});
     clientStorage.AddClient(new Client {Name = "Дмитрий", ContactName = "Дмитрий"});
 }
コード例 #3
0
 public void Start(MainWindow window)
 {
     var dataManager = new DataManager();
     var clientStorage = new ClientStorage();
     var projectStorage = new ProjectStorage();
     LoadDefaultData(dataManager, clientStorage, projectStorage);
     window.DataContext = PrepareMainViewModel(clientStorage, projectStorage);
     window.Show();
 }
コード例 #4
0
 private void LoadDefaultData(DataManager dataManager, ClientStorage clientStorage, ProjectStorage projectStorage)
 {
     dataManager.LoadDefaultClients(clientStorage);
     dataManager.LoadDefaultProjects(projectStorage);
 }
コード例 #5
0
 public void SetUp()
 {
     clientStorage = new ClientStorage();
 }