Click here to Skip to main content
15,916,949 members
Home / Discussions / C#
   

C#

 
AnswerRe: Multithreading program! Pin
Ashfield25-Jun-08 1:30
Ashfield25-Jun-08 1:30 
GeneralRe: Multithreading program! Pin
TaiZhong25-Jun-08 1:57
TaiZhong25-Jun-08 1:57 
GeneralRe: Multithreading program! Pin
leppie25-Jun-08 2:06
leppie25-Jun-08 2:06 
GeneralRe: Multithreading program! Pin
TaiZhong25-Jun-08 3:37
TaiZhong25-Jun-08 3:37 
GeneralRe: Multithreading program! Pin
SteveNY25-Jun-08 3:48
SteveNY25-Jun-08 3:48 
GeneralRe: Multithreading program! Pin
TaiZhong25-Jun-08 5:44
TaiZhong25-Jun-08 5:44 
Questioncystal report Pin
cse.vidhya25-Jun-08 0:57
cse.vidhya25-Jun-08 0:57 
AnswerRe: cystal report Pin
Christian Graus25-Jun-08 1:36
protectorChristian Graus25-Jun-08 1:36 
AnswerRe: cystal report Pin
leppie25-Jun-08 2:03
leppie25-Jun-08 2:03 
AnswerRe: cystal report Pin
Verghese25-Jun-08 3:21
Verghese25-Jun-08 3:21 
Questioncrystal report - very urgent Pin
cse.vidhya25-Jun-08 0:53
cse.vidhya25-Jun-08 0:53 
QuestionMustUnderstand WCF connecting to Java web service [modified] Pin
Simon Lime25-Jun-08 0:52
Simon Lime25-Jun-08 0:52 
NewsRe: MustUnderstand WCF connecting to Java web service Pin
Simon Lime7-Jul-08 1:06
Simon Lime7-Jul-08 1:06 
QuestionOOP question: correct obect composition in C# Pin
Metal7625-Jun-08 0:41
Metal7625-Jun-08 0:41 
AnswerRe: OOP question: correct obect composition in C# Pin
Christian Graus25-Jun-08 0:49
protectorChristian Graus25-Jun-08 0:49 
Questionhow i can run a dll Pin
wasimsharp25-Jun-08 0:22
wasimsharp25-Jun-08 0:22 
AnswerRe: how i can run a dll Pin
Christian Graus25-Jun-08 0:23
protectorChristian Graus25-Jun-08 0:23 
GeneralRe: how i can run a dll Pin
wasimsharp25-Jun-08 0:37
wasimsharp25-Jun-08 0:37 
GeneralRe: how i can run a dll Pin
Christian Graus25-Jun-08 0:45
protectorChristian Graus25-Jun-08 0:45 
AnswerRe: how i can run a dll Pin
Mbah Dhaim25-Jun-08 3:43
Mbah Dhaim25-Jun-08 3:43 
Questiontreeview and mdichild Pin
ginji2025-Jun-08 0:06
ginji2025-Jun-08 0:06 
AnswerRe: treeview and mdichild Pin
DaveyM6925-Jun-08 7:56
professionalDaveyM6925-Jun-08 7:56 
GeneralRe: treeview and mdichild [modified] Pin
ginji2025-Jun-08 15:15
ginji2025-Jun-08 15:15 
QuestionInterfaces and Casting - I'm struggling. Pin
stovesy24-Jun-08 23:57
stovesy24-Jun-08 23:57 
A little background.

I'm playing with BusinessObjects and Factory(s) which contain collections of BusinessObjects.

My business objects all derive from a BusinessObjectBase class.
I have an IBusinessObjectBase interface, which the BusinessObjectBase implements.

My factory objects all derive from a FactoryBase class.
The FactoryBase class is generic (FactoryBase<T> where T : IBusinessObjectBase)
I have an IFactoryBase interface, which the FactoryBase impliments.
public interface IFactoryBase<T> where T : IBusinessObjectBase

Everything works fine (I'm not sure if the model is a little simplistic maybe)

Now.
I'm wanting to create a status bar, which displays a few properties from the current BusinessObject, and the currenct Factory (Like data errors, read only info etc.).
So I created a test to see how to go about this, but encountered a problem.

customerFactory cFact = new customerFactory();

if (cFact is IFactoryBase<IBusinessObjectBase> ) TestContext.WriteLine("IFactoryBase supported");
if (cFact is IComponent) TestContext.WriteLine("IComponent supported");
if (((IFactoryBase<IBusinessObjectBase> )cFact).IsClean) TestContext.WriteLine("Factory is clean");


customerFactory is derived from FactoryBase, and does indeed support the IFactoryBase interface.
public class customerFactory : FactoryBase<customer>
The customer object is derived from BusinessObjectBase, and supports IBusinessObjectBase

The first line, fails even though my Factory does support the interface.
The second line succeeds (IComponent is indeed supported)
And the third line fails to cast.

Many thanks.
AnswerRe: Interfaces and Casting - I'm struggling. Pin
leppie25-Jun-08 2:11
leppie25-Jun-08 2: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.