ATMLCommonLibrary.controls.document.DocumentLibrarySelectionForm.cmbDocumentType_SelectedIndexChanged C# (CSharp) Method

cmbDocumentType_SelectedIndexChanged() private method

private cmbDocumentType_SelectedIndexChanged ( object sender, EventArgs e ) : void
sender object
e EventArgs
return void
        private void cmbDocumentType_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (cmbDocumentType.SelectedIndex != -1)
            {
                dbDocument.DocumentType documentType = (dbDocument.DocumentType)Enum.Parse(typeof(dbDocument.DocumentType), cmbDocumentType.Text);
                documentLibraryListControl.Items.Clear();
                documentLibraryListControl.DefaultDocumentType = documentType;
                List<Document> documents = DocumentManager.GetDocumentsByType((int)documentType);
                foreach (Document document in documents)
                {
                    //--------------------------------------------------------------------------------------//
                    //--- Only add to the Library List if the document is not already selected in a list ---//
                    //--------------------------------------------------------------------------------------//
                    //INFO: This may not work because an instrument may have multiple instances
                    //if (selectedDocumentIds.Find( s => s == document.uuid ) == null)
                    documentLibraryListControl.AddListViewObject(document);
                }
            }
        }