Beispiel #1
0
 protected override void DisposeHook()
 {
     NanoleafPlugin.getControllers().ForEach(c => c.PanelAdded   -= PanelAdded);
     NanoleafPlugin.getControllers().ForEach(c => c.PanelRemoved -= PanelRemoved);
     NanoleafPlugin.ControllerAdded -= NanoleafPlugin_ControllerAdded;
     base.DisposeHook();
 }
Beispiel #2
0
        private void setInstance()
        {
            this._instance = NanoleafPlugin.getAllPanels(this.deviceType).FirstOrDefault(p => p.ID.Equals(this.panelId));

            NanoleafPlugin.getControllers().ForEach(c => c.PanelAdded   -= PanelAdded);
            NanoleafPlugin.getControllers().ForEach(c => c.PanelRemoved -= PanelRemoved);

            if (this._instance == null)
            {
                NanoleafPlugin.getControllers().ForEach(c => c.PanelAdded += PanelAdded);
            }
            else
            {
                NanoleafPlugin.getControllers().ForEach(c => c.PanelRemoved += PanelRemoved);
            }
        }