.NET Components for Mobility

How to compare ItemId?

Last post 08-09-2008 1:49 PM by PeterFoot. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-08-2008 6:47 PM

    How to compare ItemId?

     Hi,

    It seems I can't compare two ItemId.

    I have the following code:

    ItemId _myItemId;

    void session_MessagingItemCreated(object sender, MessagingItemEventArgs e)
            {
                _myIemId = e.ItemId;

            }

    void session_MessagingItemModified(object sender, MessagingItemEventArgs e)

           {

              if ( e.ItemId == _myItemId ) { ... do something with the message...}

           }

    The overloaded operator (from ItemId class) == never returns 'true'. I have tried to use ItemId.Equals(_myItemId) but it also never returns 'true'.

    The only way I can reliably compare two ItemId's is by using the code below:

    void session_MessagingItemModified(object sender, MessagingItemEventArgs e)

           {

                  if ( e.ItemId.ToString().CompareTo(_myItemId.ToString()) == 0 ) {...do something with the message...}

            }

    Am I doing something wrong here? I am using 3.2 Eval version

    Thank you.

    andreiaf

                    

     

  • 08-09-2008 4:49 AM In reply to

    Re: How to compare ItemId?

    This is a bug in the 3.2 Evaluation. It is resolved in the 3.3 release.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
  • 08-09-2008 6:57 AM In reply to

    Re: How to compare ItemId?

     Thanks Peter,

    Is eval version 3.3 available for download?

    Regards,

     

     

  • 08-09-2008 1:49 PM In reply to

    Re: How to compare ItemId?

    Because 3.3 was mainly a performance and bug fix release we decided not to update the evaluation version which would have delayed the release. For now I would recommend using your string workaround with the evaluation.

    Peter

    Peter Foot
    Microsoft Device Application Development MVP
    www.peterfoot.net | www.inthehand.com
Page 1 of 1 (4 items)
Copyright © 2001-2008 In The Hand Ltd. All rights reserved. Terms of Use and Privacy Policy.