예제 #1
0
        private void trimButton_Click(object sender, EventArgs e)
        {
            if (listViewSrs.SelectedItems.Count != 1)
                return;

            SR sr = (SR)listViewSrs.SelectedItems[0].Tag;
            TrimSRCommand trimCmd = new TrimSRCommand(Program.MainWindow, sr);
            if (trimCmd.CanExecute())
                trimCmd.Execute();
        }
예제 #2
0
        private void RefreshButtons()
        {
            buttonProperties.Enabled = listViewSrs.SelectedItems.Count == 1;

            // Trim button
            if (listViewSrs.SelectedItems.Count == 1)
            {
                SR sr = (SR)listViewSrs.SelectedItems[0].Tag;
                TrimSRCommand trimCmd = new TrimSRCommand(Program.MainWindow, sr);
                trimButton.Visible = trimCmd.CanExecute();
            }
            else
            {
                trimButton.Visible = false;
            }
        }