Sando Options remarks

Dec 26, 2012 at 12:09 AM

Hi,

During development of hi-jacking of Ctrl+F shortcut I had to deal with SandoOptions and 2 things came into my mind:

1. Each time Sando Options are needed, even an access to single property from them, they are recreated from the dialog page. I think there's only one instance of sando options neccessary, that should be common for all classes. Maybe the implementation and usage of this class should be adapted to Singleton model?

2. I think good practice would be to provide some manager for options that handles changes made in options dialog page. For example if I commit changes in options dialog page it should automatically update the sando options instance and perform some other actions (ideally it should also inform about the changes the interested classes).

If the current approach has a good explanation or You have better suggestions to improving options section please comment here.

Appreciate Your thoughts and remarks ;)

Dec 28, 2012 at 2:08 AM
Cob4in wrote:

Hi,

1. Each time Sando Options are needed, even an access to single property from them, they are recreated from the dialog page. I think there's only one instance of sando options neccessary, that should be common for all classes. Maybe the implementation and usage of this class should be adapted to Singleton model?

2. I think good practice would be to provide some manager for options that handles changes made in options dialog page. For example if I commit changes in options dialog page it should automatically update the sando options instance and perform some other actions (ideally it should also inform about the changes the interested classes).

If the current approach has a good explanation or You have better suggestions to improving options section please comment here.

Appreciate Your thoughts and remarks ;)

Hi Cob4in! 

Sorry for the delay... was offline for a few days.  Anyway, I just took a real quick look at the code and it looks like you're right.  If you are up for it please feel free to fix this behavior so that the options are just read once per session (until they are updated).  

In my opinion this would be a very good first contribution.  The hijack Crtl+F task is actually a *really* big task and I would recommend against doing that one as your first bug.  It would be really cool to see an 'options-manager'!

Please feel free to contact me if you want to discuss anything else... I'm here to help as you make your first contribution!

Merry Christmas and Happy New Year!

Dave

Dec 28, 2012 at 10:01 AM

Hi, 

Hijacking CtrlF takes me so long because I've a lot other things to do. I learnt how to capture binding for the key and give it back. However I wonder what is the best way to preserve existing bindings. I tried to copy shortcuts configuration to another vsix as in the tutorial on msdn, but it doesn't work for me. Maybe simple changes to xml would be better?

2nd question is concerning this Options Manager, I would like to subscribe it to OnApply event raised when OK button in Tools.Options is pressed. Does anyone know how can I get that? I did it for now adding an event AppliedChanges to SandoDialogPage and raising it when SandoDialogPage.OnApply() function is called (I didn't find direct access to that event from environment).

 

Once again appreciate Your thoughts.

 

Happy new Year!