Visual Studio 2008 Class Diagram designer - visual-studio

I'm using VS class diagram designer. How can I get the blue lines as that in the following image? Thanks!
(source: microsoft.com)

You have to right click on properties and select show as association or show as collection association, as in each property in your class object which has an association can have this view where you can physically see the association between objects. Just a different view.
Andrew

Related

How to display all class and its base classes members in Visual Studio?

How to display all class and its base classes members in Visual Studio while in the text editor? What I do is go into any method and type 'this.'. and look at what intellisense displays. Is there an easier way?
I use Resharper.
You can use the Hierarchies tool window, which will show the type hierarchy of the currently selected type. You can select each node in the hierarchy and display a preview, which will optionally consist of either the members defined at that point in the hierarchy, or all inherited members.

VS 2010 Class Designer not rendering relationships correctly

I'm using the Visual Studio 2010 Class Diagram designer and it does a nice job of showing relationships between a parent class and the classes that make up the properties of the parent. In the below sample, we can see that the IFoo interface has a property named Bar which is of type IBar.
However, if I add existing classes, interfaces, etc... that were created outside the designer it does not show the relationships. See sample below...
The code is all the same; and correct; but the representation on the design surface is different. For existing classes, is there a way to instruct the designer to make the correct links without having to manually recreate the items using the designer?
I wasn't able to find a way to do it for the whole diagram, but I did find a Property level context-menu item (e.g. Show as Association) which fixes it one Property at a time.

What ListBox like control is used in Collections Editor of Visual Studio

I need to create a from which uses the same ListBox as the one from Collection Editor of Visual Studio (The ListBox under the Members label). Please, explain exactly which WinForms control is this and which of its properties are set?
You can see the control I am asking about under the Members: label of every collection editor form in design time of Visual Studio.
Thank you.
Hopefully this can get you started. There's other (probably better...) samples out there, but this is a basic starter which can help you get the concept:
http://msdn.microsoft.com/en-us/library/9zky1t4k%28VS.90%29.aspx
Quote:
This example shows how to create a
control named ContactCollectionEditor
that implements a custom collection
editor. The example shows how to
specify the exact type of the object
that a page developer can add to the
control's collection property when
using a custom collection editor. You
associate a collection editor with a
collection property (or the type of
the property) by applying the
EditorAttribute to the collection
property of the control.

Viewing a list of Controls associated with a class in Visual Studio IDE

I'm using the form designer in VS.
I placed a label on my form, and then deleted it's text.
Currently, I can not locate the label.
How do I see a list of controls associated with a given class?
View --> Other Windows --> Document Outline
If you look in the properties window there should be a dropdown of all the controls on the form. You can select a control you can see and then you should see that control in the dropdown list. Then open the list and find the control you are looking for.
In your launched Visual Studio IDE open:
I - Solution Explorer with CTRL+ALT+L,
II - Document Outline with CTRL+ALT+T.
III - Open any class from the Solution Explorer to see the Document Outline populate accordingly.

How to extend the ADO.NET entity designer?

Does anyonw know how to extend, i.e., add funcionalities to the Entity Designer in Visual Studio?
For instance, I want to right click a property of an entity on the designer and have a new option on the context-menu that allows me to do any stuff I want.
The Entity Designer in VS 2008 SP1 doesn't have many extensibility hooks. What you could do is leverage the Visual Studio extensibility (VSIP, now known as VSX):
Add in your own context menu
Use IVsMonitorSelection to get the current selection, from which you can get ISelectionContainer.
If the user has selected the diagram surface, you can then cast ISelectionContainer as DiagramDocView. This is part of 'DSL', which is the framework that the Entity Designer uses for its designer surface.
From here you can do lots of things within the DiagramDocView. DiagramDocView.CurrentDiagram will give you the Diagram object. You can call Diagram.NestedChildShapes to get all shapes in the diagram. To make changes to the diagram, you will have to create a DSL transaction and perform your edits to the shapes in the transaction. This is simply another level above the Entity Designer and everything will be handled correctly:
using (Transaction tx = store.TransactionManager.BeginTransaction(txText))
{
// do something, such as creating an EntityTypeShape;
tx.Commit();
}
The Entity Designer in VS 2010 will have a lot more extensibility hooks to allow you to influence the model through the property window or through the wizard. New extensibility work in the new 'Model First' feature will basically allow you to generate anything from a model within Visual Studio in a composable way.

Resources