public void Reg(T key, UpdaterDelegate action) { if (!updaterDict.ContainsKey(key)) { updaterDict[key] = action; } }
public ParticleLightManager( ParticleSystem <T> system, IEnumerable <LightingEnvironment> lightingEnvironments, UpdaterDelegate updater ) { System = system; _Partition = new SpatialPartition <Sector>(system.Subdivision, (sectorIndex) => new Sector(this, sectorIndex)); LightingEnvironments = lightingEnvironments; Updater = updater; }
public void RegisterUpdater(UpdaterDelegate up) { for (int i = 0; i < m_updaterDelegate.Count; ++i) { if (m_updaterDelegate[i] == up) { return; } } m_updaterDelegate.Add(up); }
private void PictureBoxUpdater(PictureBox pctrbox, Color color) { if (pctrbox.InvokeRequired) { UpdaterDelegate <PictureBox, Color> d = new UpdaterDelegate <PictureBox, Color>(PictureBoxUpdater); this.Invoke(d, new object[] { pctrbox, color }); } else { pctrbox.BackColor = color; } }
private void LabelUpdater(Label label, string labelText) { if (label.InvokeRequired) { UpdaterDelegate <Label, string> d = new UpdaterDelegate <Label, string>(LabelUpdater); this.Invoke(d, new object[] { label, labelText }); } else { label.Text = labelText; } }
public void UnRegisterUpdater(UpdaterDelegate up) { m_updaterDelegate.Remove(up); }