Chinese (People's Republic of China)  English  Français


Supinfo-Projects.com
Supinfo Students' projects



Projects
  Last project
  Top projects
  All projects

110 User's online
3168 Projects


My Supinfo-Projects

   Login
   Create account


Synopsis

   6 Hits
   Visitors Score : 20
    (3 Voter)
   0 Comments

   Read the article

Evaluate this article

20
18
16
14
12
10
8
6
4
2
0


Comment this article

Author :

Email :

Your comment :



 
2006 - Pérennisation
Use and customize of host of forms of Visual Studio 2005 in your applications .net
[30 mn of reading - published 6/6/2006 8:37:04 PM - Target : Confirmé]

Author

wildarkWilliam GUIOUBLY
Student-Engineer Supinfo Paris
SUPINFO graduate year  2007

   Write to the person
   All projects of the same author
   Mini-CV of the author

9 The DesignerOptionService service

The DesignerOptionService service is an abstract class of the namespace System.ComponentModel.Design. It provides methods for management of the option of design like the use of SnapLines, Grid or Smart Tags, etc (To consult the MSDN to know all its methods, properties and events). One recovers this service via the GetService method of the DesignSurface class, while passing the System.ComponentModel.Design. DesignerOptionService  type in parameter. 

 

Let us examine somebody of these methods, properties and events:

- The GetOptionValue method which turns over the value of the option passed in parameter.

- The SetOptionValue method   which defines a value in an option.

 

There is no DesignerOptionService service by defect in DesignSurface. We will use the System.Windows.Forms.Design. WindowsFormsDesignerOptionService class which will facilitate the management of this service to us:

class Designer : System.ComponentModel.Design.DesignSurface

{

    public Designer()

    {

        // Service of creation of name

        ServiceContainer.AddService(

typeof(System.ComponentModel.Design.Serialization.INameCreationService),

new NameCreationService());

        // Service of management of the toolbox    

        ServiceContainer.AddService(

typeof(System.Drawing.Design.IToolboxService), new ToolBoxService());

 

        // Service of view of the host

        ServiceContainer.AddService(typeof(ViewService), new ViewService());

 

        // Service of management of the menus        ServiceContainer.AddService(

typeof(System.ComponentModel.Design.IMenuCommandService), new MenuCommandService(this.ServiceContainer));

 

        // Management of options of design

        System.Windows.Forms.Design.WindowsFormsDesignerOptionService designerOptionService = new System.Windows.Forms.Design.WindowsFormsDesignerOptionService();

        // It is specified that one goes use the grid to place the components

        designerOptionService.CompatibilityOptions.ShowGrid = true;

        ServiceContainer.AddService(

typeof(System.ComponentModel.Design.DesignerOptionService), designerOptionService);

    }

}

To compile and launch the project and here what you obtain:

 

Exemple DesignOption.JPG

 

From now on one can move the controls according to the grid which has just appeared.



Articles de la même catégorie

 Pages : Top


5 Hits
0 Comments
ID3 and C4.5 algorithms
[40 mn of reading - published 6/6/2006 7:48:47 PM - Target : Confirmé]

More


9 Hits
0 Comments
Generics with .NET
[30 mn of reading - published 6/6/2006 3:37:29 PM - Target : Confirmé]

More


5 Hits
0 Comments
Widget Development
[10 mn of reading - published 6/6/2006 3:03:12 PM - Target : Débutant]

More

Powered by Campus-Booster Technology
Conditions d'utilisation & Copyright | Respect de la vie privée
© Copyright 1965-2006 Supinfo Paris, Paris Academy of Computer Science
Supinfo, Ecole Supérieure d'Informatique et Paris Academy Of Computer Science are trade marks.
23, rue de Château LANDON - 75010 PARIS - Phone : +33 (0) 153359 700 Fax : +33 (0) 153359 701

Web site autided by :