Click here to Skip to main content
15,909,829 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
GeneralRe: building architecture. Pin
montu337717-May-05 0:08
montu337717-May-05 0:08 
GeneralRe: building architecture. Pin
Christian Graus17-May-05 12:58
protectorChristian Graus17-May-05 12:58 
GeneralRe: building architecture. Pin
montu337723-May-05 4:49
montu337723-May-05 4:49 
GeneralRe: building architecture. Pin
Christian Graus23-May-05 11:43
protectorChristian Graus23-May-05 11:43 
GeneralRe: building architecture. Pin
montu337724-May-05 7:50
montu337724-May-05 7:50 
GeneralRe: building architecture. Pin
Christian Graus24-May-05 11:45
protectorChristian Graus24-May-05 11:45 
GeneralRe: building architecture. Pin
montu337724-May-05 23:26
montu337724-May-05 23:26 
GeneralRe: building architecture. Pin
Christian Graus25-May-05 12:48
protectorChristian Graus25-May-05 12:48 
montu3377 wrote:
it's working fine but i am afraid that in later on stage i have to pass controls into both classes as return values so it gives effect on main form.

Creating a new image is not a tool, the class that encapsulates an image window should be carrying the tool here, and the tools should be draw/fill/shape/text/etc.

montu3377 wrote:
Thanks a lot for your nice co-operation.
Really appriciated your efforts.


That's cool - you happened to ask in an area that I have a lot of experience, so glad to help Smile | :)

Overall, the class structure is fine, but I'd expect the tools to work like this: ( this is pseudocode, it won't compile )

class MyMainWindow
{
private ToolBase tool = new ToolNone; // Create an empty tool so the variable never has to be null


OnMenuClick()
{
switch(menuItemClicked)
{
case text:
tool.Dispose(); // Your tools will have resources you should delete in an IDisposable implimentation
tool = new ToolText(this); // The constructors will need a copy of the window if the tools are to call Invalidate() to make the window redraw when needed
break;
case freehand:
tool.Dispose();
too = new ToolFree(this);
break;
// etc
}
}

OnMouseClick(args)
{
tool.OnMouseClick(args);
}
// etc
}


Christian Graus - Microsoft MVP - C++
GeneralIncorrect value returned from this.getType ().Assembly.Location for C# COM-addin Pin
Barry G10-May-05 18:27
Barry G10-May-05 18:27 
GeneralRe: Incorrect value returned from this.getType ().Assembly.Location for C# COM-addin Pin
Barry G11-May-05 18:26
Barry G11-May-05 18:26 
QuestionHow to create a reminder notification in Pocket PC Pin
Member 19358809-May-05 21:03
Member 19358809-May-05 21:03 
QuestionHow to find a pattern in an image Pin
Tad McClellan9-May-05 16:40
professionalTad McClellan9-May-05 16:40 
AnswerRe: How to find a pattern in an image Pin
Christian Graus9-May-05 17:19
protectorChristian Graus9-May-05 17:19 
AnswerRe: How to find a pattern in an image Pin
abcxyz8224-May-05 4:56
abcxyz8224-May-05 4:56 
GeneralA few questions regarding Whidbey Beta 2 Pin
Carl Mercier9-May-05 12:35
Carl Mercier9-May-05 12:35 
GeneralRe: A few questions regarding Whidbey Beta 2 Pin
MoustafaS9-May-05 12:43
MoustafaS9-May-05 12:43 
GeneralRe: A few questions regarding Whidbey Beta 2 Pin
Carl Mercier9-May-05 13:18
Carl Mercier9-May-05 13:18 
GeneralRe: A few questions regarding Whidbey Beta 2 Pin
Christian Graus9-May-05 13:20
protectorChristian Graus9-May-05 13:20 
GeneralRe: A few questions regarding Whidbey Beta 2 Pin
Christian Graus9-May-05 13:19
protectorChristian Graus9-May-05 13:19 
GeneralRe: A few questions regarding Whidbey Beta 2 Pin
Carl Mercier9-May-05 13:47
Carl Mercier9-May-05 13:47 
GeneralRe: A few questions regarding Whidbey Beta 2 Pin
Christian Graus9-May-05 13:50
protectorChristian Graus9-May-05 13:50 
GeneralRe: A few questions regarding Whidbey Beta 2 Pin
Carl Mercier10-May-05 2:52
Carl Mercier10-May-05 2:52 
GeneralRe: A few questions regarding Whidbey Beta 2 Pin
Christian Graus10-May-05 12:52
protectorChristian Graus10-May-05 12:52 
GeneralEnterprise Library Data Access Block Pin
mrinmayeek9-May-05 7:00
mrinmayeek9-May-05 7:00 
GeneralRe: Enterprise Library Data Access Block Pin
Scott Serl9-May-05 16:18
Scott Serl9-May-05 16:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.