HighTechTalks DotNet Forums  

Using behavior service in a custom root designer

Dotnet Framework (WinForms DesignTime) microsoft.public.dotnet.framework.windowsforms.designtime


Discuss Using behavior service in a custom root designer in the Dotnet Framework (WinForms DesignTime) forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
David Husselmann
 
Posts: n/a

Default Using behavior service in a custom root designer - 05-21-2006 , 08:08 PM






Hi everyone,

I'm currently writing a custom root designer for a report designer running
inside VS. While learning about the rest of the designer framework, I
stumbled upon the Windows Forms way of doing smart tags, resize handles and
the like - the Behavior Service.

Unfortunately it seems the behavior service was only meant to work with
Windows Forms; not with any other designers. This is manifested in the
VS.NET designer host not even giving me a reference when I do a
GetService(typeof(BehaviorService)).

My question is whether there is any way to make the behavior service (and
all the other good stuff like adorners, glyphs and behaviors) work with a
custom designer that is not winforms?

Any hints will be greatly appreciated. At this stage I have two options:
either duplicate the entire behavior service framework as it stands in .NET,
or fake a windows forms designer to design my reports in (which is quite
kludgy in my opinion).

Regards
David Husselmann

Reply With Quote
  #2  
Old   
David Husselmann
 
Posts: n/a

Default RE: Using behavior service in a custom root designer - 05-23-2006 , 01:06 AM






Well, I got around the problem by subclassing the DocumentDesigner class and
staying inside the windows forms architecture - it seems that it's simply
impossible to reuse the behavior mechanisms outside this framework.

Regards,
David Husselmann


Reply With Quote
  #3  
Old   
N!ls
 
Posts: n/a

Default RE: Using behavior service in a custom root designer - 10-26-2007 , 07:47 AM



As per my uderstanding of the DesignTimeArch, you can have a BehaviourService for any Designer (even if its not of typeof FormDesigner).

In your customDesigner class while initializing u need to add add adorners and glyphs.
That's all...
See this sample code:

class myControlDesigner: ControlDesigner
{
public override void Initialize(IComponent component)
{
base.Initialize(component);
adorner = new Adorner();
adorner.Glyphs.Add(new MyCustomGlyph(BehaviorService, this.Control));
this.BehaviorService.Adorners.Add(adorner);
}
}
.. and you are done... It will do the functionality mentioned in your MyCustomGlyph class on whichever control this Designer applied to.
Ping me back for any trouble...
r[.]nilesh[@]gmail[.]com

From http://www.developmentnow.com/g/32_2...t-designer.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.