Первоначально я хотел сказать, что у вас даже нет конструктора, который использует экземпляр MyHour. Вместо этого сделайте, чтобы пользователь проверил Ничто вне класса:
Public Function GetSomeClassInstance(ByVal mh As MyHour) As SomeClass
If mh IsNot Nothing Then
Return New SomeClass(mh.TimeSpan)
Else
Throw New ArgumentNullException("mh", "MyHour instance must not be Nothing)
End If
End Function
Однако использование частного конструктора для фактического конструирования объекта, например, может работать (не проверено):
Public Class SomeClass
Public Sub New(ByVal mh As MyHour)
MyClass.New(Nothing, mh)
End Sub
Public Sub New(ByVal ts As TimeSpan)
MyClass.New(ts, Nothing)
End Sub
Private Sub New(ByVal ts As TimeSpan?, ByVal mh As MyHour)
Dim _timeSpanToUse As TimeSpan
If ts IsNot Nothing Then
_timeSpanToUse = ts.Value
Else
If mh IsNot Nothing Then
_timeSpanToUse = mh.TimeSpan
Else
Throw New ArgumentNullException("mh", "The MyHour parameter was NULL")
End If
End If
'Continue using _timeSpanToUse here...
End Sub
End Class