Ejemplo n.º 1
0
        private void WhiteboardForm_Load(object sender, EventArgs e)
        {
            //netron.View.SetBackgroundType(CanvasBackgroundTypes.Gradient);
            //Ambience amb = netron.View.Model.Pages[0].Ambience;
            //amb.BackgroundType = CanvasBackgroundTypes.Gradient;
            //amb.BackgroundColor = Color.Gold;
            //amb.GradientColor1 = Color.Gold; //Color.WhiteSmoke;
            //amb.GradientColor2 = Color.Goldenrod; //Color.SteelBlue;


            entitySelector.Entities = Service <ILibrary> .Instance.GetAllEntities();

            entitySelector.UpdateEntities();

            IMathSystem     system   = Binder.CreateSystem();
            ISystemMediator mediator = Binder.GetInstance <ISystemMediator, IMathSystem>(system);

            // attach a system logger (with console output), something
            // we get for free thanks to the channels subsystem (mediator/observer).
            LogSystemObserver lo = new LogSystemObserver(new TextLogWriter(Console.Out));

            mediator.AttachObserver(lo);

            _ctrl.Load(system);
        }
Ejemplo n.º 2
0
 protected virtual void UnloadSystem(IMathSystem system)
 {
     if (_sysMediator != null)
     {
         _sysMediator.DetachObserver(this);
         _sysMediator = null;
     }
 }
Ejemplo n.º 3
0
 public Developer1(ISystemMediator mediator)
 {
     _mediator = mediator;
     _mediator.RegisterColleague(this);
 }
Ejemplo n.º 4
0
 protected virtual void UnloadSystem(IMathSystem system)
 {
     if(_sysMediator != null)
     {
         _sysMediator.DetachObserver(this);
         _sysMediator = null;
     }
 }
Ejemplo n.º 5
0
 protected virtual void LoadSystem(IMathSystem system)
 {
     // reuses mediator if system already has one
     _sysMediator = Binder.GetInstance<ISystemMediator, IMathSystem>(system);
     _sysMediator.AttachObserver(this);
 }
Ejemplo n.º 6
0
        //public CommandChannel CurrentCommands
        //{
        //    get { return _sysMediator.CurrentSystem.Mediator.Commands; }
        //}

        #region Load/Unload System
        protected virtual void LoadSystem(IMathSystem system)
        {
            // reuses mediator if system already has one
            _sysMediator = Binder.GetInstance <ISystemMediator, IMathSystem>(system);
            _sysMediator.AttachObserver(this);
        }