Наследование: Observable, Observer
Пример #1
0
        public DestributedRepository createRepository()
        {
            DestributedRepository dr = new DestributedRepository();

            if (repositories.Count != 0)
            {
                dr.synchronizeWith(repositories[0]);
            }

            foreach (DestributedRepository repo in repositories)
            {
                repo.addObserver(dr);
                dr.addObserver(repo);
            }

            repositories.Add(dr);

            return dr;
        }
Пример #2
0
        public DestributedRepository createRepository()
        {
            DestributedRepository dr = new DestributedRepository();

            if (repositories.Count != 0)
            {
                dr.synchronizeWith(repositories[0]);
            }

            foreach (DestributedRepository repo in repositories)
            {
                repo.addObserver(dr);
                dr.addObserver(repo);
            }

            repositories.Add(dr);

            return(dr);
        }
Пример #3
0
 public void synchronizeWith(DestributedRepository repository)
 {
     this.data = repository.getData();
 }
Пример #4
0
 public void synchronizeWith(DestributedRepository repository)
 {
     this.data = repository.getData();
 }