lw_common.ui.note_ctrl.update_cur_note_controls C# (CSharp) Method

update_cur_note_controls() private method

private update_cur_note_controls ( ) : void
return void
        private void update_cur_note_controls() {
            int sel = notesCtrl.SelectedIndex;

            ++ignore_change_;
            // note: the only time when sel < 0 is possible only when the user hasn't selected any line yet
            //       (thus, even cur_line is pointing nowhere)
            addNoteToLine.Visible = sel >= 0;
            addNoteToLineLabel.Visible = sel >= 0;

            addNoteToLine.Text = "";
            if (sel >= 0) {
                var i = notesCtrl.GetItem(sel).RowObject as note_item;
                if (i.the_note != null)
                    addNoteToLineLabel.Text = i.the_note.author_name == author_name_ ? "Edit Note to Line" : "Reply to " + i.the_note.author_initials;
                else
                    addNoteToLineLabel.Text = "Add Note to Line";
                addNoteToLine.Text = "[" + (lines_[i.line_id].idx + 1) + "]";
                curNote.Text = i.the_note != null ? i.the_note.note_text : "";
                curNote.Enabled = true;
                selectColor.Visible = i.the_note != null && i.the_note.author_name == author_name_ && i.the_note.note_text.Trim() != "";
            } else {
                selectColor.Visible = false;
                curNote.Enabled = false;
                curNote.Text = "";
            }

            --ignore_change_;
        }