RemoveObserver() public method

public RemoveObserver ( IObserver, observer ) : void
observer IObserver,
return void
 public void undo()
 {
     if (history.Peek() is DeSpawnInteraction)
     {
         s.RemoveObserver(this.GetComponent <UIManager>()._createdObject);
     }
     history.Peek().undo();
     future.Push(history.Pop());
 }
        static void Main(string[] args)
        {
            Console.WriteLine("Hello World!");
            ISubject  subject   = new Subject();
            IObserver observer1 = new FirstObserver(subject);
            IObserver observer2 = new SecondObserver(subject);

            subject.AddObserver(observer1);
            subject.AddObserver(observer2);
            subject.HaveSomeTechLogic();
            subject.RemoveObserver(observer1);
            subject.HaveSomeTechLogic();
        }
Beispiel #3
0
    void Start()
    {
        Subject subject = new Subject();

        Observer1 observer1 = new Observer1();
        Observer2 observer2 = new Observer2();

        subject.RegisterObserver(observer1);
        subject.SetData("Hello World!");

        subject.RegisterObserver(observer2);
        subject.SetData("Re:Hello World!");

        subject.RemoveObserver(observer1);
        subject.SetData("Re:Re:Hello World!");
    }
 public void RemoveRegister(Subject dataPro)
 {
     this.dataPro = dataPro;
     dataPro.RemoveObserver(this);
 }
 public void UnRegister()
 {
     sub.RemoveObserver(this);
 }
 private void RemoveObserver(IObserver observer) => _subject.RemoveObserver(observer);
Beispiel #7
0
 private void OnDestroy()
 {
     Subject.RemoveObserver(this);
 }
Beispiel #8
0
 public void RemoveObserverOnFirstInput(IObserver observer) => _subject.RemoveObserver(observer);
Beispiel #9
0
 private void OnDisable()
 {
     Subject.RemoveObserver(this);
 }
Beispiel #10
0
 private void OnDisable()
 {
     Subject.RemoveObserver(this);
     seeker.CancelCurrentPathRequest();
 }
        public void RemoveObserver_ShouldReturn_removed_successfuly()
        {
            User us = new User("Lavanya", sb);

            Assert.Equal("Removed successfully", sb.RemoveObserver(us));
        }
Beispiel #12
0
 void OnDestroy()
 {
     lever.RemoveObserver(this);
 }