public MainWindowViewModel() { _service = new PersonStorage(); Search = new CommandHandler <object>(OnSearch); _persons = new ObservableCollection <IPerson>(); Persons = new ListCollectionView(_persons); }
static void Main(string[] args) { personStorage = new PersonStorage(); LoadPeople(); FamilyGraph = new FamilyGraph(personStorage); LoadRelations(); relations = new BaseRelationships(FamilyGraph); using (var reader = new StreamReader(Path.Combine("InputFiles", "Testcase.txt"))) { while (!reader.EndOfStream) { var input = reader.ReadLine(); var values = input.Split(" ").Select(m => m.Trim()).ToList(); // Console.WriteLine($"TestCase: {input}"); if (values[0] == "ADD_CHILD") { AddChild(values); } else if (values[0] == "GET_RELATIONSHIP") { try { GetRelation(values); } catch (Exception) { } } Console.WriteLine(); } } //Console.ReadKey(); }
public void SetUp() { PersonStore = new PersonStorage(); george = PersonStore.AddPerson("George", Gender.Male); mary = PersonStore.AddPerson("Mary", Gender.Female); bob = PersonStore.AddPerson("Bob", Gender.Male); sally = PersonStore.AddPerson("Sally", Gender.Female); dave = PersonStore.AddPerson("Dave", Gender.Male); }
public void SetUp() { storage = new PersonStorage(); PersonDTO george = storage.AddPerson("George", Gender.Male); PersonDTO mary = storage.AddPerson("Mary", Gender.Female); PersonDTO bob = storage.AddPerson("Bob", Gender.Male); PersonDTO sally = storage.AddPerson("Sally", Gender.Female); familyGraph = new FamilyGraph(storage); }
public PersonsApplication(ILogger logger, IIdentifierFactory idFactory, IPersonStorage storage, IEmailService emailService) { logger.GuardAgainstNull(nameof(logger)); idFactory.GuardAgainstNull(nameof(idFactory)); storage.GuardAgainstNull(nameof(storage)); emailService.GuardAgainstNull(nameof(emailService)); this.logger = logger; this.idFactory = idFactory; this.storage = storage; this.emailService = emailService; }
public EmailService(IPersonStorage storage) { storage.GuardAgainstNull(nameof(storage)); this.storage = storage; }
public static void InitializeStorage(IPersonStorage <Client> clients) { entities = clients; }
public FamilyGraph(IPersonStorage personStore) { Families = new Dictionary <PersonDTO, Relationships>(); storage = personStore; }
public static void InitializeStorage(IPersonStorage <Student> students) { entities = students; }