Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / September 2006

Tip: Looking for answers? Try searching our database.

ITrackSelection.OnSelectChange from a custom root designer does not seem to work

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joe Burke - 23 Aug 2006 16:35 GMT
Hi,

 I'm having trouble using the ITrackSelection interface/service.  From
within my custom RootDesigner, I'd like to substitute the set of components
being designed with a different set of objects that I'd like to appear in
the 'Properties Window'.  My understanding is that all I need to do is to
call ITrackSelection.OnSelectChange(...) with my own SelectionContainer.
I'm doing this and I've confirmed that my new objects are in the container
however, they are not appearing in the properties window, the original set
of components are still there.  I'm calling 'OnSelectChange' from within an
'ActiveDesignerChanged' event from IDesignerEventService.

Is it valid to call this method from a custom root designer?  It looks like
'OnSelectChange' is being called after my call with the original components
and it's undoing my call.  Where should I be calling 'OnSelectChange' for my
root designer?

Thanks,

Joe

*************** SAMPLE CODE ************************

Here's my sample code that is a method on my Package:
void designerEventSvc_ActiveDesignerChanged(object sender,
ActiveDesignerEventArgs e)

{

IDesignerHost activeHost = e.NewDesigner;

if (activeHost != null)

{

IDesigner rootDesigner = activeHost.GetDesigner(activeHost.RootComponent);

Debug.Assert(rootDesigner != null, "Root designer is null");

if (rootDesigner is StyleRootDesigner) // one of my root designers

{

IContainer container = ((StyleRootDesigner)rootDesigner).ExampleContainer;
// my selection container w/ different set of objects.

STrackSelection trackSelSvc =
(STrackSelection)activeHost.GetService(typeof(STrackSelection));

if (trackSelSvc != null)

{

((ITrackSelection)trackSelSvc).OnSelectChange(null);

selContainer.SelectableObjects = container.Components;

selContainer.SelectedObjects = container.Components;

((ITrackSelection)trackSelSvc).OnSelectChange(selContainer);

}

}

}

}
Gary Chang[MSFT] - 12 Sep 2006 08:46 GMT
Hi Joe,

I am afraid you have some problems to register your MSDN managed account,
so our system is unable to pick up this post.

Do you still monitor this issue? Please update us and we will looking into
this problem.

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Joe Burke - 12 Sep 2006 09:24 GMT
Hi Gary,

Yes, I'm still looking for a solution to this problem.  Let me know if I
need to re-post it otherwise, please just follow up on here.
...I'll look into my account and try to see what's wrong.

Thanks,
Joe

> Hi Joe,
>
[quoted text clipped - 29 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Gary Chang[MSFT] - 13 Sep 2006 10:06 GMT
Hi Joe,

No need to repost this issue, we will follow up this issue here.

I am performing research on this issue and will get back to you as soon as
possible. I appreciate your patience.

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Gary Chang[MSFT] - 14 Sep 2006 04:38 GMT
Hi Joe,

Our VSIP specialist suggests you verify whether that service is available
at first.  It may have the problem that the designer host service provider
chains calls to VS service provider. You can use the following code to
check it:

STrackSelection trackSelSvc =
(STrackSelection)activeHost.GetService(typeof(STrackSelection));
if (trackSelSvc != null) <== Is this condition satisfied?
{
..

Thanks!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Joe Burke - 14 Sep 2006 05:22 GMT
Thanks Gary,

 Yes, I mention in my original post that I'm actually getting past that
point.  I've confirmed that the service is available.
 I have also confirmed the following next steps:
   1. I am calling the method 'OnSelectChange' with my correct substitution
set of objects that I'd like to appear in the properties window.
   2. I have also noticed that by using the IVsMonitorSelection interface,
I can see that my selection is taking place with my new container of
objects.  However, immediately after I change the selection container,
IVsMonitorSelection informs me that the current selection container is being
changed back to my original set of components from my root designer.  These
are the objects that I am trying to substitute out.  That's what prompted me
to question whether or not I am calling 'OnSelectChange' in the correct
place.  From my source code in the original post, you can see that I am
calling it from the 'ActiveDesignerChanged' method of the
'IDesignerEventService' interface.
I hope that this makes sense.

-Joe

> Hi Joe,
>
[quoted text clipped - 22 lines]
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
Gary Chang[MSFT] - 15 Sep 2006 06:31 GMT
Hi Joe,

Thanks for the response!

This issue may need some offline support. Would you please send an email to
me discuss this issue? Then we will contact you directly.
(Please remove the "online" of my email address alias)

Thanks for your understanding!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.