Click here to Skip to main content
15,898,035 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using C# to make a DOS app? Pin
DavidNohejl15-May-05 10:46
DavidNohejl15-May-05 10:46 
AnswerRe: Using C# to make a DOS app? Pin
Peter Vertes15-May-05 16:31
Peter Vertes15-May-05 16:31 
GeneralRe: Using C# to make a DOS app? Pin
CiNN23-May-05 7:29
CiNN23-May-05 7:29 
GeneralC# - Insert data into Paradox table without primary key. Pin
elapid15-May-05 8:13
elapid15-May-05 8:13 
GeneralRe: C# - Insert data into Paradox table without primary key. Pin
Marc Clifton15-May-05 9:08
mvaMarc Clifton15-May-05 9:08 
GeneralRe: C# - Insert data into Paradox table without primary key. Pin
elapid15-May-05 10:34
elapid15-May-05 10:34 
GeneralRe: C# - Insert data into Paradox table without primary key. Pin
Marc Clifton15-May-05 14:25
mvaMarc Clifton15-May-05 14:25 
GeneralQuick Command Pattern Question Pin
Dato15-May-05 5:08
Dato15-May-05 5:08 
I was reading a simple article on the Command Pattern and had a quick question.
The article is short and its here:

http://www.c-sharpcorner.com/Code/2002/Mar/CommandPatternsInCSCKU.asp[^]
For example if I had a base Class DVDPlayer and I wanted a status on the player would this be implemented this way ??

<br />
public class DVDPlayer : ICommand	<br />
	{<br />
		protected string mCDStatus="";<br />
		<br />
		public CDPlayer()<br />
		{<br />
<br />
		}<br />
		public string CDStatus<br />
		{<br />
			get{return this.mCDStatus;}<br />
		}<br />
<br />
		public void Execute()<br />
		{<br />
			<br />
		}<br />
public class DVDPlay: DVDPlayer, ICommand <br />
	{<br />
		public CDPlay()<br />
		{<br />
<br />
		}<br />
		//Please note "new" below"<br />
		public new void Execute()<br />
		{<br />
			base.mCDStatus = "Playing";<br />
		}<br />
<br />
	}<br />
<br />


With my main method like this ??:

<br />
Remote rm = new Remote();<br />
			CDPlayer player = new CDPlayer();<br />
			player = new CDPlay();<br />
			rm.Invoke(player);<br />
			MessageBox.Show(player.CDStatus.ToString());<br />


Is this the best implementation ?? Good Design ? Any ideas ?
thks in advance ..
Note : Remote class below:

<br />
public class Remote<br />
		{<br />
			public Remote()<br />
			{<br />
				<br />
			}<br />
			public void Invoke(ICommand cmd)<br />
			{<br />
				cmd.Execute();<br />
			}<br />
			<br />
		}<br />

GeneralRe: Quick Command Pattern Question Pin
DavidNohejl15-May-05 5:40
DavidNohejl15-May-05 5:40 
GeneralRe: Quick Command Pattern Question Pin
Marc Clifton15-May-05 8:58
mvaMarc Clifton15-May-05 8:58 
Generalusing a webcam in my C# application Pin
GaMBiT_KC15-May-05 2:09
GaMBiT_KC15-May-05 2:09 
GeneralRe: using a webcam in my C# application Pin
Andrew Kirillov15-May-05 2:20
Andrew Kirillov15-May-05 2:20 
GeneralRe: using a webcam in my C# application Pin
GaMBiT_KC16-May-05 3:11
GaMBiT_KC16-May-05 3:11 
GeneralRe: using a webcam in my C# application Pin
pubududilena15-May-05 18:04
pubududilena15-May-05 18:04 
GeneralRe: using a webcam in my C# application Pin
GaMBiT_KC16-May-05 3:14
GaMBiT_KC16-May-05 3:14 
Generalusing a dll in my project Pin
Anonymous15-May-05 0:43
Anonymous15-May-05 0:43 
GeneralRe: using a dll in my project Pin
MoustafaS15-May-05 1:37
MoustafaS15-May-05 1:37 
GeneralRe: using a dll in my project Pin
Anonymous15-May-05 1:50
Anonymous15-May-05 1:50 
GeneralRe: using a dll in my project Pin
MoustafaS15-May-05 1:59
MoustafaS15-May-05 1:59 
GeneralRe: using a dll in my project Pin
Anonymous15-May-05 2:05
Anonymous15-May-05 2:05 
GeneralRe: using a dll in my project Pin
Anonymous15-May-05 2:12
Anonymous15-May-05 2:12 
GeneralRe: using a dll in my project Pin
MoustafaS15-May-05 2:16
MoustafaS15-May-05 2:16 
GeneralAsynchronous Client/Server messages Pin
methodincharge14-May-05 23:37
methodincharge14-May-05 23:37 
GeneralRe: Asynchronous Client/Server messages Pin
S. Senthil Kumar15-May-05 2:53
S. Senthil Kumar15-May-05 2:53 
GeneralRe: Asynchronous Client/Server messages Pin
methodincharge15-May-05 7:13
methodincharge15-May-05 7:13 

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.