custom code serializer

cyuksel

Newcomer
Joined
Mar 14, 2003
Messages
18
Location
turkey
hi,
i have a big problem. i have been generated an addin project,and in it, i want to add custom project item template (has design view that my custom usercontrol can be dragged from toolbox to design view and code part which is not C# or VB just xml). i could generate view part of my intention via implementing IRootDesigner,DocumentDesigner and ToolBoxUser interface.but i must reference this rootdesigner class with another component class it may be C# code. but i dont want to generate C# code i want to generate xml.
in my first attempt, i think that rootdesigner class can be attached to any xml file, and i wrote some questions to newsgroup. but no body reply.
so i hanged my opinion. I have second opinion for solving my problem that adding C# code part that, only i want, into any C# component class. for example .net code generator should not write initialize method or other codes that it generate automatically after every event. i want to prevent automatic code generation and add my custom code.
can i do this?
if yes,how?
thanks for your patience.
 
I'm not entirely sure I understand everything you're trying to do, but I have a good idea. You've implemented IRootDesigner, which is good. Does this work? You are able to open the designer in Visual Studio?

I don't know how to add custom templates to the new files dialog in Visual Studio, and I would guess that to completely override the way it generates code, you would have to get some kind of extensibility SDK.

You need to go completely above the whole CodeDom serializer thing, since CodeDom can't represent XML.
 
Come to think of it, the RootDesignerSerializerAttribute class may be what you're looking for - although I don't know what the IDE will do with your serialized document if it isn't a collection of CodeDom classes.
 
hi divil,
thanks for reply.We have thought that we should write a root codedom serializer class and use it with rootcodedomserializerattribute, too. But we don't know the class from which our serializer class will inherit. Because that class is not public.
If I succeed to write a root serializer,would I prevent the .Net code generator to write automatic code for my class.

I don't want a InitializeComponent function in my code. I want to write all code by myself.

Is it possible???
If it is possible, can you send me any example?(i could not find anything)
 
The class you would inherit form is probably System.ComponentModel.Design.Serialization.CodeDomSerializer. However, I think this is probably a red herring. I seriously doubt there is a way of you doing what you need to do without writing some serious extensibility add-in to vs.net to make a whole new type of document.

My only suggestion would be to contact Microsoft about how to go about this.
 
Back
Top