2013-07-26 1 views
2

vb.net에서 초기화, 설정 및 ReturnStructure 인라인 가능합니까? 만약 내가인라인 구조 초기화, 설정 및 반환?

Structure

Structure CopyAndPasteUniquesAndExistenceStructure 
    Dim duplicatePoints As List(Of Array) 
    Dim inexistentPoints As List(Of Array) 
    Dim insertedRows As List(Of Object) 
End Structure 

어떻게이 의사를 할 수있는이?

Return New CopyAndPasteUniquesAndExistenceStructure... 

답변

3
Return New CopyAndPasteUniquesAndExistenceStructure With {.duplicatePoints = New List(Of Array), .inexistentPoints = New List(Of Array), .insertedRows = New List(Of Object)} 

또는 당신은 전문 생성자를 추가 할 수 있습니다. 이는 입력 내용의 유효성을 검사하거나 목록을 읽기 전용으로 만들려는 경우에 유용합니다 (일반적으로 목록에는 많은 의미가 있습니다).