Click here to Skip to main content
15,918,889 members
Home / Discussions / C#
   

C#

 
Questioncan threading is way in finding co-ordinate? Pin
montu337730-Nov-04 23:28
montu337730-Nov-04 23:28 
AnswerRe: can threading is way in finding co-ordinate? Pin
DougW481-Dec-04 4:31
DougW481-Dec-04 4:31 
GeneralRe: can threading is way in finding co-ordinate? Pin
montu33771-Dec-04 17:32
montu33771-Dec-04 17:32 
Questioncan threading is way in finding co-ordinate? Pin
montu337730-Nov-04 23:27
montu337730-Nov-04 23:27 
AnswerRe: can threading is way in finding co-ordinate? Pin
Christian Graus30-Nov-04 23:36
protectorChristian Graus30-Nov-04 23:36 
Generalsearching of line in scanned image Pin
montu337730-Nov-04 22:52
montu337730-Nov-04 22:52 
GeneralRe: searching of line in scanned image Pin
Christian Graus30-Nov-04 23:33
protectorChristian Graus30-Nov-04 23:33 
GeneralHelp needed on code simplification Pin
lj_rules30-Nov-04 21:40
lj_rules30-Nov-04 21:40 
Can anyone help me simplify the code below, given that MyObject and OtherObject comes from a 3rd party COM component (some DLL from somewhere)?

<br />
public class BaseClass<br />
{<br />
	public void GetPropsforMyObject(ref myObjHere, CommonStuff commstuffhere)<br />
	{<br />
		myObjHere.CommonProperty1 = commstuffhere.Prop1<br />
		myObjHere.CommonProperty2 = commstuffhere.Prop2<br />
		.<br />
		.<br />
		.<br />
		myObjHere.CommonPropertyN = commstuffhere.PropN<br />
	}<br />
<br />
	public void GetPropsforOtherObject(ref OtherObjHere, CommonStuff commstuffhere)<br />
	{<br />
		OtherObjHere.CommonProperty1 = commstuffhere.Prop1<br />
		OtherObjHere.CommonProperty2 = commstuffhere.Prop2<br />
		.<br />
		.<br />
		.<br />
		OtherObjHere.CommonPropertyN = commstuffhere.PropN<br />
	}<br />
}<br />
<br />
public class Class1 : BaseClass<br />
{<br />
	public void Class1(CommonStuff commstuff)<br />
	{<br />
		MyObject myobj = new MyObject();<br />
<br />
		GetPropsforMyObject(ref myobj, commstuff);<br />
		<br />
		//...this class does one thing afterward<br />
	}<br />
}<br />
<br />
public class Class2 : BaseClass<br />
{<br />
	public void Class2(CommonStuff commstuff)<br />
	{<br />
		OtherObject otherobj = new OtherObject();<br />
<br />
		GetPropsforOtherObject(ref otherobj, commstuff);<br />
		<br />
		//...this class does another thing afterward<br />
	}<br />
}<br />


Note that GetPropsforMyObject and GetPropsforOtherObject does almost exactly the same thing, except that the object being passed values to is different.

Neither can I modify MyObject and OtherObject because they are 3rd-party COM objects.

Any help would be appreciated Smile | :)
GeneralRe: Help needed on code simplification Pin
Daniel Turini30-Nov-04 21:54
Daniel Turini30-Nov-04 21:54 
GeneralRe: Help needed on code simplification Pin
lj_rules2-Dec-04 13:26
lj_rules2-Dec-04 13:26 
GeneralRe: Help needed on code simplification Pin
TyronX1-Dec-04 10:19
TyronX1-Dec-04 10:19 
GeneralTcpListener : Best approach to check the active connections Pin
Zishan Haider30-Nov-04 21:08
Zishan Haider30-Nov-04 21:08 
GeneralRe: TcpListener : Best approach to check the active connections Pin
Daniel Turini30-Nov-04 21:50
Daniel Turini30-Nov-04 21:50 
GeneralRe: TcpListener : Best approach to check the active connections Pin
Zishan Haider1-Dec-04 1:03
Zishan Haider1-Dec-04 1:03 
GeneralRe: TcpListener : Best approach to check the active connections Pin
Zishan Haider1-Dec-04 3:31
Zishan Haider1-Dec-04 3:31 
GeneralC# with MySql Pin
Member 150205630-Nov-04 20:16
Member 150205630-Nov-04 20:16 
GeneralRe: C# with MySql Pin
Daniel Turini30-Nov-04 21:49
Daniel Turini30-Nov-04 21:49 
GeneralQuotes around string Pin
StephenMcAllister30-Nov-04 19:46
StephenMcAllister30-Nov-04 19:46 
GeneralRe: Quotes around string Pin
Alex Korchemniy30-Nov-04 19:53
Alex Korchemniy30-Nov-04 19:53 
GeneralRe: Quotes around string Pin
StephenMcAllister30-Nov-04 20:10
StephenMcAllister30-Nov-04 20:10 
GeneralRe: Quotes around string Pin
Alex Korchemniy30-Nov-04 20:18
Alex Korchemniy30-Nov-04 20:18 
GeneralRe: Quotes around string Pin
StephenMcAllister30-Nov-04 20:30
StephenMcAllister30-Nov-04 20:30 
GeneralNow Pin
Yulianto.30-Nov-04 19:43
Yulianto.30-Nov-04 19:43 
GeneralRe: Now Pin
Alex Korchemniy30-Nov-04 19:51
Alex Korchemniy30-Nov-04 19:51 
GeneralRe: Now Pin
Yulianto.30-Nov-04 21:11
Yulianto.30-Nov-04 21:11 

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.