public MainWindowViewModel()
 {
     _service = new PersonStorage();
     Search   = new CommandHandler <object>(OnSearch);
     _persons = new ObservableCollection <IPerson>();
     Persons  = new ListCollectionView(_persons);
 }
示例#2
0
        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();
        }
示例#3
0
 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);
 }
示例#4
0
        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;
 }
示例#6
0
 public EmailService(IPersonStorage storage)
 {
     storage.GuardAgainstNull(nameof(storage));
     this.storage = storage;
 }
示例#7
0
 public static void InitializeStorage(IPersonStorage <Client> clients)
 {
     entities = clients;
 }
示例#8
0
 public FamilyGraph(IPersonStorage personStore)
 {
     Families = new Dictionary <PersonDTO, Relationships>();
     storage  = personStore;
 }
示例#9
0
 public static void InitializeStorage(IPersonStorage <Student> students)
 {
     entities = students;
 }