Click here to Skip to main content
15,913,722 members
Home / Discussions / C#
   

C#

 
AnswerRe: Hashtable reading text file??? Pin
Nick Parker23-Aug-04 13:36
protectorNick Parker23-Aug-04 13:36 
GeneralRe: Hashtable reading text file??? Pin
gman4423-Aug-04 14:50
gman4423-Aug-04 14:50 
GeneralRe: Hashtable reading text file??? Pin
Kika_24-Aug-04 1:46
Kika_24-Aug-04 1:46 
GeneralUndo/Redo and dynamic lists in Property Grid Pin
smartyosu23-Aug-04 12:33
smartyosu23-Aug-04 12:33 
GeneralRe: Undo/Redo and dynamic lists in Property Grid Pin
leppie23-Aug-04 21:44
leppie23-Aug-04 21:44 
GeneralRe: Undo/Redo and dynamic lists in Property Grid Pin
Heath Stewart24-Aug-04 7:33
protectorHeath Stewart24-Aug-04 7:33 
GeneralForcing a class to provide a specific ctor Pin
matthias s.23-Aug-04 11:45
matthias s.23-Aug-04 11:45 
GeneralRe: Forcing a class to provide a specific ctor Pin
Werdna23-Aug-04 12:09
Werdna23-Aug-04 12:09 
No, you can't force specific constructor, but you can force to have a method that returns an instance and create factory for it.

C#
<br />
interface IFoo<br />
{<br />
	... methods here...<br />
}<br />
<br />
interface IFooFactory<br />
{<br />
	IFoo CreateIFoo(string a, int b);<br />
}<br />
<br />
public class MyFoo : IFoo<br />
{<br />
... methods from IFoo...<br />
public static IFooFactory factory = new MyFooFactory();<br />
<br />
}<br />
<br />
class MyFooFactory : IFooFactory<br />
{<br />
	public IFoo CreateIFoo(string a, int b)<br />
	{<br />
		return new MyFoo(a, b);<br />
	}<br />
}<br />
<br />
then to use it:<br />
IFoo foo = IFoo.factory.CreateIFoo("hello", 1);<br />
<br />

GeneralThanks! Pin
matthias s.23-Aug-04 12:55
matthias s.23-Aug-04 12:55 
GeneralRe: Forcing a class to provide a specific ctor Pin
Charlie Williams23-Aug-04 12:11
Charlie Williams23-Aug-04 12:11 
GeneralFileStrea,m Pin
Christian Graus23-Aug-04 11:28
protectorChristian Graus23-Aug-04 11:28 
GeneralRe: FileStrea,m Pin
Colin Angus Mackay23-Aug-04 11:36
Colin Angus Mackay23-Aug-04 11:36 
GeneralRe: FileStrea,m Pin
Christian Graus23-Aug-04 11:59
protectorChristian Graus23-Aug-04 11:59 
GeneralRe: FileStrea,m Pin
Heath Stewart24-Aug-04 7:26
protectorHeath Stewart24-Aug-04 7:26 
GeneralPacket Monitor Pin
Member 131332123-Aug-04 11:14
Member 131332123-Aug-04 11:14 
GeneralRe: Packet Monitor Pin
eggie523-Aug-04 15:25
eggie523-Aug-04 15:25 
GeneralRe: Packet Monitor Pin
leppie23-Aug-04 21:46
leppie23-Aug-04 21:46 
GeneralAmazon.com API 4.0 Help Pin
j1e1g123-Aug-04 11:06
j1e1g123-Aug-04 11:06 
GeneralRe: Amazon.com API 4.0 Help Pin
Heath Stewart24-Aug-04 7:21
protectorHeath Stewart24-Aug-04 7:21 
GeneralParallel port Pin
Christian Graus23-Aug-04 10:42
protectorChristian Graus23-Aug-04 10:42 
GeneralRe: Parallel port Pin
Nick Parker24-Aug-04 4:43
protectorNick Parker24-Aug-04 4:43 
GeneralRe: Parallel port Pin
Christian Graus24-Aug-04 11:37
protectorChristian Graus24-Aug-04 11:37 
GeneralRe: Parallel port Pin
Nick Parker25-Aug-04 1:34
protectorNick Parker25-Aug-04 1:34 
GeneralRe: Parallel port Pin
Steve Mayfield24-Aug-04 14:47
Steve Mayfield24-Aug-04 14:47 
Generalrunning scripts inside a c# application Pin
johanna4223-Aug-04 8:51
johanna4223-Aug-04 8:51 

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.