This question is locked. New answers and comments are not allowed.
The analysis does not recognize dynamic objects, so it shows an cast as redundant, although it isnĀ“t!!
On dynamic object a cast is required, although it has the correct type.
e.g.
this
.CurrentCallState = (TAPI_CALLSTATE)eventArgs <----the NOT redundant cast
--> For more infos see the attached picture "JC-CastAnalysis.jpg"
private
void
TapiActiveX_OnCallStateChange(dynamic eventArgs)
{
this
.LastCallState =
this
.CurrentCallState;
this
.CurrentCallState = (TAPI_CALLSTATE)eventArgs;
// wenn hereinkommender Anruf und dann weg (IDLE oder diconnected), dann ist es ein Missed Call
if
(
this
.LastCallState == TAPI_CALLSTATE.CALLSTATE_OFFERING
&& (
this
.CurrentCallState == TAPI_CALLSTATE.CALLSTATE_IDLE
||
this
.CurrentCallState == TAPI_CALLSTATE.CALLSTATE_DISCONNECTED))
{
CallHistoryEntry entry =
new
CallHistoryEntry() { Id = -1, PhoneNumber =
this
.PhoneNumber, IsMissed =
true
, InsertDate = DateTime.Now };
this
.CallHistory.Add(entry);
}
if
(
this
.OnCallStateChange !=
null
)
{
TapiEventArgs tapiEventArgs =
new
TapiEventArgs();
this
.OnCallStateChange(
this
, tapiEventArgs);
}
}