GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Regulus.Remote/document/communications-notifier.md at github-readme · jiowchern/Regulus.Remote

Expand file tree

/

communications-notifier.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
77 lines (66 loc) · 1.46 KB
/

communications-notifier.md

Copy path

File metadata and controls

77 lines (66 loc) · 1.46 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

Communications

Interface Notifier.

The interface can broadcast its child interface to the client.

Define the propertyRegulus.Remote.Notifier<T>.

public interface IFoo
{
    Regulus.Remote.Notifier<IBar> BarNotifier {get;}
}

The server implements the property.

namespace Server
{
    public interface IBar
    {
    }

    class Bar : IBar
    {    
    }

    class Foo : IFoo
    {
        readonly NotifiableCollection<IBar> _Bars;
        readonly Notifier<IBar> _BarNotifier;

        public Foo()
        {
            _Bars = new NotifiableCollection<IBar>();
            _BarNotifier = new Regulus.Remote.Notifier<IBar>(_Bars);            
        }

        Regulus.Remote.Notifier<IBar> IFoo.BarNotifier => _BarNotifier;        

        public void AddBar(Bar bar)
        {
            _Bars.Items.Add(bar);            
        }

        public void RemoveBar(Bar bar)
        {
            _Bars.Items.Remove(bar);            
        }    

        public void Dispose()
        {
            _Bars.Items.Clear();
            _BarNotifier.Dispose();
        }            
    }    
}

In the client.

namespace Client
{
    class Program
    {
        void _OnFoo(IFoo foo)
        {
            foo.BarNotifier.Base.Supply += _OnBar;
        }
        void _OnBar(IBar bar)   
        {
            
        }
    }
}

Restrictions

  1. Notifier supports only interfaces.
  2. No duplicate instances may be added.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.