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); }
protected virtual void UnloadSystem(IMathSystem system) { if (_sysMediator != null) { _sysMediator.DetachObserver(this); _sysMediator = null; } }
public Developer1(ISystemMediator mediator) { _mediator = mediator; _mediator.RegisterColleague(this); }
protected virtual void UnloadSystem(IMathSystem system) { if(_sysMediator != null) { _sysMediator.DetachObserver(this); _sysMediator = null; } }
protected virtual void LoadSystem(IMathSystem system) { // reuses mediator if system already has one _sysMediator = Binder.GetInstance<ISystemMediator, IMathSystem>(system); _sysMediator.AttachObserver(this); }
//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); }