Inheritance: 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();
 }