Nanook.QueenBee.EditorForm.lstItems_ItemSelectionChanged C# (CSharp) Method

lstItems_ItemSelectionChanged() private method

private lstItems_ItemSelectionChanged ( object sender, System.Windows.Forms.ListViewItemSelectionChangedEventArgs e ) : void
sender object
e System.Windows.Forms.ListViewItemSelectionChangedEventArgs
return void
        private void lstItems_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
        {
            if (!e.IsSelected)
                return;

            QbItemEditorBase editor;
            try
            {
                SendMessage(gboEdit.Handle, WM_SETREDRAW, 0, IntPtr.Zero);
                clearEditor();

                QbItemBase itm = e.Item.Tag as QbItemBase;

                if (itm == null)
                    return;

                if (itm is QbItemScript)
                {
                    editor = new ScriptEditor();
                    ((ScriptEditor)editor).SelectedTabIndex = AppState.ScriptActiveTab;
                }
                else if ((itm.Format == QbFormat.ArrayPointer || itm.Format == QbFormat.ArrayValue) && itm.QbItemType != QbItemType.ArrayStruct && itm.QbItemType != QbItemType.ArrayArray)
                    editor = new SimpleArrayEditor();
                else
                    editor = new GenericQbItemEditor();
                editor.Updated += new UpdatedEventHandler(editor_Updated);
                editor.Error += new ErrorEventHandler(editor_Error);

                editor.QbItem = itm;
                editor.Left = 3;
                editor.Top = 14;
                editor.Width = gboEdit.Width - 6;
                editor.Height = gboEdit.Height - 17;
                editor.Anchor = AnchorStyles.Bottom | AnchorStyles.Left | AnchorStyles.Right | AnchorStyles.Top;
                gboEdit.Controls.Add(editor);
            }
            finally
            {
                SendMessage(gboEdit.Handle, WM_SETREDRAW, 1, IntPtr.Zero);
                gboEdit.Refresh();
            }
        }
EditorForm