protected override void OnEnable(bool enable) { if (enable) { Window.PreselectionChanged += Window_PreselectionChanged; } else { Window.PreselectionChanged -= Window_PreselectionChanged; } if (enable) { type = TypeComboBox.Type; pitch = PitchTextBox.Pitch; angle = AngleTextBox.Value; positionOffset = PositionComboBox.Offset; TypeComboBox.Command.TextChanged += TypeCommand_TextChanged; PitchTextBox.Command.TextChanged += PitchCommand_TextChanged; AngleTextBox.Command.TextChanged += AngleCommand_TextChanged; PositionComboBox.Command.TextChanged += PositionCommand_TextChanged; } else { TypeComboBox.Command.TextChanged -= TypeCommand_TextChanged; PitchTextBox.Command.TextChanged -= PitchCommand_TextChanged; AngleTextBox.Command.TextChanged -= AngleCommand_TextChanged; PositionComboBox.Command.TextChanged -= PositionCommand_TextChanged; } }
void TypeCommand_TextChanged(object sender, CommandTextChangedEventArgs e) { type = TypeComboBox.Type; pitch = PitchTextBox.Pitch; }
protected override void OnInitialize() { Reset(); type = TypeComboBox.Type; pitch = PitchTextBox.Pitch; }
protected override void OnEnable(bool enable) { if (enable) Window.PreselectionChanged += Window_PreselectionChanged; else Window.PreselectionChanged -= Window_PreselectionChanged; if (enable) { type = TypeComboBox.Type; pitch = PitchTextBox.Pitch; angle = AngleTextBox.Value; positionOffset = PositionComboBox.Offset; TypeComboBox.Command.TextChanged += TypeCommand_TextChanged; PitchTextBox.Command.TextChanged += PitchCommand_TextChanged; AngleTextBox.Command.TextChanged += AngleCommand_TextChanged; PositionComboBox.Command.TextChanged += PositionCommand_TextChanged; } else { TypeComboBox.Command.TextChanged -= TypeCommand_TextChanged; PitchTextBox.Command.TextChanged -= PitchCommand_TextChanged; AngleTextBox.Command.TextChanged -= AngleCommand_TextChanged; PositionComboBox.Command.TextChanged -= PositionCommand_TextChanged; } }
void TypeCommand_TextChanged(object sender, CommandTextChangedEventArgs e) { type = TypeComboBox.Type; pitch = PitchTextBox.Pitch; }
protected override void OnInitialize() { Reset(); type = TypeComboBox.Type; pitch = PitchTextBox.Pitch; }