This Forum is ARCHIVE only
For LightSwitch questions,
please use the official forums at:

http://social.msdn.microsoft.com/forums/en-US/lightswitch/threads


Index error when use "Show Fewer Buttons"
Last Post 06 Mar 2012 03:43 AM by Delordson. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages Informative
Ramon BarrenaUser is Offline
New Member
New Member
Send Private Message
Posts:2
Avatar

--
06 Mar 2012 01:35 AM
    I recently purchased your shell with the source code and am very happy.
    I found a small bug that I mention it here for you to consider in future releases.

    When you use the option "Show Fewer Buttons" and there are no visible buttons in the menu, it displays an error like "index". To fix this you just have to modify in the LightSwitch.OutlookBar\OutlookBar.cs file the ResetMenu function and leave it this way:

    private void ResetMenu(int Adjust)
    {
    int numberofOutlookBarButtons = this.Items.Count;
    int numberofOutlookBarButtonsOnShow = GetButtonsOnShowCount();
    numberofOutlookBarButtonsOnShow += Adjust;

    if (numberofOutlookBarButtonsOnShow < 0)
    numberofOutlookBarButtonsOnShow = 0;

    .......
    }


    And with that the problem is solved.

    regards,
    DelordsonUser is Offline
    New Member
    New Member
    Send Private Message
    Posts:47
    Avatar

    --
    06 Mar 2012 03:43 AM
    Hi Ramon,

    Thanks for spotting that and more importantly for the fix. Its amazing, you test and test and think you've checked every scenario and yet trip up on something obvious

    I'll roll your fix into the next update, which you will of course be entitled to for free (all updates are free for 1 year).

    I'm really pleased you find the source useful. I've since made some improvements to how images are obtained and put into the menus. I had hoped for an official way in v2 but I'm guessing we'll have to wait and see what v3 brings so I've gone ahead and refactored the code to make it more robust. I'll be releasing the upadted code soon (after some more testing ).

    Thanks
    Delordson
    You are not authorized to post a reply.


    Microsoft Visual Studio is a registered trademark of Microsoft Corporation / LightSwitch is a registered trademark of Microsoft Corporation