void ddl_SelectedIndexChanged(object sender, EventArgs e) { ComboBox obj = sender as ComboBox; GuiLinkerTag tag = obj.Tag as GuiLinkerTag; Debug.Assert(tag != null, "wrong tag"); switch (tag.type) { case GuiLinkerType.DrumPad: SetBoostValue((GuiDrumPad)tag.data, (byte)obj.SelectedItem); break; case GuiLinkerType.Button: SetButtonSwitchType((GuiDrumButton)tag.data, (SwitchType)obj.SelectedItem); break; case GuiLinkerType.DPad: SetButtonSwitchType((GuiDrumDPad)tag.data, (SwitchType)obj.SelectedItem); break; case GuiLinkerType.DPadVelocity: case GuiLinkerType.ButtonVelocity: Debug.Assert(false, "wrong type"); break; default: Debug.Assert(false, "unkown type"); break; } }
void nup_ValueChanged(object sender, EventArgs e) { NumericUpDown obj = sender as NumericUpDown; GuiLinkerTag tag = obj.Tag as GuiLinkerTag; Debug.Assert(tag != null, "wrong tag"); switch (tag.type) { case GuiLinkerType.DrumPad: SetMidiNote((GuiDrumPad)tag.data, (byte)obj.Value); break; case GuiLinkerType.Button: SetMidiNote((GuiDrumButton)tag.data, (byte)obj.Value); break; case GuiLinkerType.ButtonVelocity: SetButtonVelocity((GuiDrumButton)tag.data, (byte)obj.Value); break; case GuiLinkerType.DPad: SetMidiNote((GuiDrumDPad)tag.data, (byte)obj.Value); break; case GuiLinkerType.DPadVelocity: SetButtonVelocity((GuiDrumDPad)tag.data, (byte)obj.Value); break; default: Debug.Assert(false, "unkown type"); break; } }
void chk_CheckedChanged(object sender, EventArgs e) { CheckBox obj = sender as CheckBox; GuiLinkerTag tag = obj.Tag as GuiLinkerTag; Debug.Assert(tag != null, "wrong tag"); switch (tag.type) { case GuiLinkerType.DrumPad: SetBoostEnabled((GuiDrumPad)tag.data, obj.Checked); break; case GuiLinkerType.Button: case GuiLinkerType.ButtonVelocity: case GuiLinkerType.DPad: case GuiLinkerType.DPadVelocity: Debug.Assert(false, "wrong type"); break; default: Debug.Assert(false, "unkown type"); break; } }