Wrong: Cast not required

2 posts, 0 answers
  1. Matthias Bibo
    Matthias Bibo avatar
    72 posts
    Member since:
    Mar 2010

    Posted 14 Jun 2012 Link to this post

    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);
                }
            }
  2. Ivan
    Admin
    Ivan avatar
    106 posts

    Posted 20 Jun 2012 Link to this post

    Hi,

    Thank you for your feedback. I was able to reproduce your issue and we are going to do our best to fix it as soon as possible.
    Thank you for your help!

    All the best,
    Ivan
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft banner
Back to Top