Advertisement
Monday, September 06, 2010

.net Tips and Tricks

New .net Books!
 
LATEST NEWS

04.11.2005
BlueVision becomes a Microsoft Certified Partner!

03.30.2005

03.01.2005
Two development books get an update for Visual Studio .NET 2003

01.05.2005
BlueVision launches the Community Technology Preview release of CopAlert™, www.copalert.com

12.20.2002
BlueVision in MSDN Magazine
Tips and Tricks

Customize Visual Studio .NET's start page

    The Visual Studio .NET Start Page is normally the first window that is displayed when the application is started. The default page is shown to the left. It consists of some predefined tabs (menu items) on the left, with each corresponding to an application (tab view) on the right. The application (or tab view) is further composed of PaneSets (TabControl) and Panes (Tabs and TabViews) A few important ones are described below.

Get Started is an application containing a PaneSet with two panes, Projects and Find Samples. The Projects pane lists the most recently opened projects. The number of projects listed may be customized by navigation to Tools | Options | Environment | General. Find Samples allows you to search for framework samples on the local machine.

Web Hosting is an application that lists.NET hosting companies. The lists is modified dynamically, and is controlled outside the Visual Studio .NET application.

My Profile allows you to customize the environment. Common variables include the Keyboard Scheme, Window Layout, and Help Filter.

 

Start Page Physical Architecture

The Start Page can be divided phsyically into 4 areas:

  • Content
  • Schema
  • Transformation
  • Data

Content is composed of the HTML and script files for displaying the start page. The main content files are located in a directory similar to the following: C:\Program Files\Microsoft Visual Studio .NET\Common7\IDE\HTML\1033. 1033 is the LCID (LocaleID) for your current language. Three main files reside at this location: default.htm, vshome.js and vshome.css.

Schema represents the format of the data that VS expects, when trying to render the Start Page. The only schema can be found in the same directory specified above. You may view this file if you wish, but note that it is not entirely accurate, as we will see below. Briefly speaking, some attributes are not specified as required, but VS expects them to be present.

Transformation is composed of the XSL style sheets that transform the data (described below) into readable HTML for the Start Page. Various XSLT files are located in the same directory specified above.

Data represents all data that is to be displayed and processed by the Start Page. Visual Studio .NET's default data can be found in the same location described above. When creating custom tabs, your tabs should be located in one of the following subdirectories, depending on your preferences (The HTML subdirectories are relative to \Program Files\Microsoft Visual Studio .NET\Common7\IDE) :

  • \ HTML \ Custom \   - Place all non-language-dependent custom tabs here.
  • \ HTML \ [lcid] \ Custom \  - Place language-dependent custom tabs here.
  • [ApplicationDataFolder] \ Visual Studio .NET \ Start Page \ Custom Tabs - Place all user-specific custom tabs here. The [ApplicationDataFolder] is found in the registry at HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders

 

Customizing the Start Page

NOTE: When using the schema to customize the start page, remember that some attributes are required, even though the schema may not reflect the fact. Also, case sensitivity is important. The XSLT files expect the exact (case-sensitive) attributes to appear in your data.

Use the following procedures to customize a simple start page tab:

  1. Create a blank XML file in the custom directory of your choice (see Data section above).
  2. The root element for each XML file must be TabDefinition if many Tabs will reside in a single file. A tab is simply a menu item found on the left of the VS.NET Start Page. If only one Tab is needed, then the root element will be Tab.
  3. For each Tab element, you must specify a Name and ID attribute. Even though the schema says these attributes are not required, the XSLT will used the ID for JScript creation, and will throw exceptions even the attribute is not present. Also, the Name attribute is required to display the Tab. To be on the safe side, it's better to go ahead and provide a value for ID on every element. Also worth noting is the Filterable attribute. This boolean attribute specifies whether to render the Filter drop down list as seen in the Headlines pane. of the start page.
  4. For each Tab element, you must specify an Application subelement. The Application describes the Tab View. An Application is composed of either a PaneSet, or a Pane. A Pane is the visual surface that contains other controls. A PaneSet is a collection of panes, which may be rendered as a list, tabs, tree. Currently, the PaneSet can only render Panes as tabs.
  5. Create a PaneSet element as a child of Application and give it a unique ID. Also, create a collection of Pane subelements for the PaneSet, giving each a unique ID, and a Title for display purposes. The Projects and Find Samples tabs are examples of Panes.
  6. In each pane, you may choose from a variety of controls to be rendered. Some common ones follow:
    • Form - Represents a container for grouping controls. All controls on a form are laid out from left to right.
    • Button - Renders a button.
    • ButtonField - Renders a button input field.
    • SubmitField - Renders a submit button input field.
    • CheckBox - Renders a check box.
    • TextField - Renders a simple text input field.
    • PasswordField - Renders a password input field. (However, it doesn't work. You can fix it yourself in the vstab.xdr file.)
    • FileField - Renders a file input field, but only if nested inside a Form element. Also, the Form element must have its Method attribute set to "post" and its EncType attribute set to "multipart/form-data".
    • Image - Renders an image.All attributes except OnClick are required and must be set, otherwise the image won't render.
    • RadioGroup - Represents a group of radio buttons (RadioButton elements).
    • FieldSet - Draws a box around a collection of controls. Similar to a Windows GroupBox. The Title attribute of the FieldSet is used as the legend (or label).
    • Label - Renders as an HTML Label.
    • TextSpan - Represents a restricted text span with limited formatting and containment. Only other TextSpans, Images, Breaks, and Hyperlinks can be contained.
    • Listbox - Not Working, but should render a list box.
    • Break - Causes a line break.
    • HRule - Renders a horizontal rule.
    • Title - Renders a title in bold font.
    • LItemEx - A link item, which represents an Image, Text, and a Hyperlink. The LinkGroup attribute specifies which LinkGroup the link should be shown in.
    • Hyperlink - Represents a simply hyperlink.
    • ProjectMRUList - Displays a list of the most recently opened Visual Studio .NET projects.
    • ShowSamples - Displays the Samples Search tool. Note that this is the one element whose ID attribute should not be set.
    • SearchMSDN - Displays the MSDN Search tool.
    • SearchGotDotNet - Not Working. Displays the GotDotNet (UDDI Web Services) Search tool.
    • Include - Allows inclusion of an external data file.
    • LinkGroupSet - Contains a collection of LinkGroup items.
    • LinkGroup - Represents a group for a collection of LItemEx elements. LItemEx elements may be defined anywhere in the document. The LinkGroup groups them together during rendering. This grouping only works, however, if the LItemEx elements are defined within a Links element.

Here is a sample TabDefinition data file.

<?xml version="1.0" encoding="UTF-8" ?>
<TabDefinition>
    <Tab Name="BlueVision" ID="bv_projects">
        <Application>
            <PaneSet ID="projectsPaneSet" Layout="tabs">
                <Pane ID="ProjectsPane" Title="Projects">
                    <FieldSet ID="projects" Title="Projects">
                        <Break></Break>
                        <Button ID="buildGradeBook" Text="Build"></Button>  
                            <Hyperlink ID="gradebook" URL="">Open GradeBook</Hyperlink>
                        <Break></Break>
                        <Button ID="buildSimonSez" Text="Build"></Button>  
                            <Hyperlink ID="simonsez" URL="">Open SimonSez</Hyperlink>
                        <Break></Break>
                        <Break></Break>
                    </FieldSet>
                    <Break></Break>
                    <Break></Break>
                    <Break></Break>
                </Pane>
                <Pane ID="ToolsPaneSet" Title="Documentation">
                    <LinkGroup ID="internal" Title="Internal Documentation"></LinkGroup>
                    <LinkGroup ID="external" Title="External Documentation"></LinkGroup>
                </Pane>
            </PaneSet>
            <Data>
                <Context>
                    <Links>
                        <LItemEx>
                            <LItem ID="litem" Relative="0" 
                                      LinkGroup="internal" 
                                      URL="http://samplelink.htm">Tips and Tricks</LItem>
                            <Blurb>Launch the Tips and Tricks web site.</Blurb>
                        </LItemEx>
                        <LItemEx>
                            <LItem ID="litem2" Relative="0" 
                                      LinkGroup="external" 
                                      URL="http://samplelink.htm">MSDN</LItem>
                            <Blurb>Go to the MSDN web site.</Blurb>
                        </LItemEx>
                        <LItemEx>
                            <LItem ID="litem3" 
                                      Relative="0" 
                                      LinkGroup="internal" 
                                      URL="http://samplelink.htm">.NET Coding Standards</LItem>
                            <Blurb>View the online coding standards.</Blurb>
                        </LItemEx>
                    </Links>
                </Context>
            </Data>
        </Application>
    </Tab>
</TabDefinition>
		

Here is the first Pane definition (Projects):

Here is the second Pane definition (Documentation):


Back to Tips and Tricks

Terms Of Use © 2000 - 2010 BLUEVISION LLC. ALL RIGHTS RESERVED. Privacy Policy