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 LoadSystem(IMathSystem system)
 {
     // reuses mediator if system already has one
     _sysMediator = Binder.GetInstance<ISystemMediator, IMathSystem>(system);
     _sysMediator.AttachObserver(this);
 }
Ejemplo n.º 3
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);
        }