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 / April 2006

Tip: Looking for answers? Try searching our database.

Data sources in miscellaneous project system

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Notre Poubelle - 07 Apr 2006 22:21 GMT
Hello,

Can the Data Sources window be used with the 'miscellaneous' project system?
I am rehosting a modified windows form designer so that it is registered
with the miscellaneous project system; that is, I have created an VS editor
with a user control that hosts the Windows Form design surface and integrates
with the Visual Studio toolbox.  

I am creating several custom controls for use with my designer and wrapping
some existing controls, such as the DataGridView control.  The DataGridView
control has a DataSource property.  Normally, in a vanilla C# Windows
Application project system, when I use the DataGridView control, I can choose
to add a new data source.  However, in the case of my custom editor in the
miscellaneous project system, when I choose to select a Datasource from the
property grid, there is no facility to add a new data source.  Likewise, if I
use a BindingSource component in this environment, the DataSource property
doesn't give me the ability to add a datasource.

So my question is, is it possible to use the Data Source Window and thus
controls like DataGridView and BindingSource from a miscellaneous project
system?  What about through a custom project system, other than the
miscellaneous project or is this ablility restricted to the C#, VB .NET and
other MS project systems?

Thanks,
Notre
"Gary Chang[MSFT]" - 10 Apr 2006 11:19 GMT
Hi Notre,

This is a quick note to let you know that I am performing research on this
issue and will get back to you as soon as possible. I appreciate your
patience.

Thanks for your understanding.

Best regards,

Gary Chang
Microsoft Community Support
======================================================
PLEASE NOTE the newsgroup SECURE CODE and PASSWORD will be updated at 9:00
AM PST, February 14, 2006.  Please complete a re-registration process by
entering the secure code mmpng06 when prompted. Once you have entered the
secure code mmpng06, you will be able to update your profile and access the
partner newsgroups.
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Yan-Hong Huang[MSFT] - 11 Apr 2006 07:36 GMT
Hello Notre,

This issue looks complicated. We discussed it and there is no answer so
far. We may need to contact support team for it. If you are still
monitoring the issue, could you please post a reply here and so we will go
ahead to contact our support team?

Thanks very much for your patience.

Sincerely,
Yanhong Huang
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
Notre Poubelle - 11 Apr 2006 18:12 GMT
Hi Yanhong Huang,

Yes, I am still monitoring the thread and would like to know more.  Please
contact your support team.

Thanks,
Notre
Mike Wong (Microsoft) - 12 Apr 2006 23:16 GMT
Hi Notre,

so it looks like the data source window tries to get the active project by
checking out the property on the hierarchy i.e.

hierarchy.Getproperty(VSITEMID_ROOT, VSHPROPID_ExtObject, out o

EnvDTE.Project project - o as Project

You can try a simple macro that gets the project object for the solution
to see if it works for you.  The data source tool window also checks if it
is not a web project and if project.CodeModel is non-null.  You can use a
quick macro to check for the codemodel property via looking at the
properties of your project object where p =  DTE.Solution.Projects.Item(1).
Look at the locals window to see if your particular project implements a
codemodel.

After those checks, they iterate through each of the projectitems with a
xsd extension.  For each schema projectitem, they get the filecodemodel and
iterate through the codeelements.  There might be some other checks later
on but those are the most important checks at the beginning when the data
source window is being initialized.

I hope that helps.

Thanks!
Mike Wong
Microsoft Developer Support
Notre Poubelle - 17 Apr 2006 17:49 GMT
Hi Mike,

Thanks for the explanation.  My first question was whether the data source
window would work with a 'miscellaneous' project system.  I tried the little
macro you suggested with the miscellaneous project system and the CodeModel
is indeed not defined, so I guess going this route will not work for me.  I
appreciate the further comments on what the data source tool window looks
for, as this may prove to be useful for me in the future, when I implement a
custom project system.

Thanks,
Notre
Mike Wong (Microsoft) - 18 Apr 2006 01:57 GMT
Hi Notre,

I don't see anything obvious in addition to the earlier post  but there is
one area that might hinder some functionality.

On right click on a column node in the data sources window,  Select Edit
dataset with designer.  In the xsd designer, if we right click and select
the context menu option "view code".  I noticed the internal code tries to
obtain the codedomprovider from the service provider, a projectitem, or via
project language (compares the guid returned from codemodel.language with
VB, CSharp, JSharp).  If it fails, then possibly the view code command will
fail.

I think one of the larger issues in the extensibility realm is how you can
test and truly integrate your packages into existing features of Visual
Studio.  It is sort of a two part question - how do you know if you are
providing what one package wants?  Will you be able to change it if we hit
a roadblock?   For example, we can test a certain code path out of using
the data sources window with a custom project system but we could hit a
roadblock with one conditional in the Microsoft.VsDesigner.dll that say
checks on language.  I think some source code access would be beneficial
but that potentially only addresses part of the question. Hmmmmm....

thanks!
mike
"Gary Chang[MSFT]" - 17 Apr 2006 06:28 GMT
Hi Notre,

Would you mind letting me know the result of the suggestions? If you need
further assistance, feel free to let me know. I will be more than happy to
be of assistance.

Have a nice day!

Best regards,

Gary Chang
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
Notre Poubelle - 17 Apr 2006 17:51 GMT
Hi Gary,

Mike's comments answered my questions.

Thanks for putting me in touch with him, Gary!

Notre

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.