J
Julia
Hi,
In general my question is how can I set properties on a concrete class
while programming against interfaces
For example I have a MailServerFatory which can create two types of
Mail servers and return IMailServer
public interface IMailServer
{
void Send();
MailServerType Type {get;}
}
the first is SMTP server
public class SMTPMailServer : IMailServer
{
public void Send(){}
public string SMTPHost
public MailServerType Type
}
The second is EXCHMailServer
public class EXCHMailServer:IMailServer
{
public string UserName
public string PassWord
public string Folder
public void Send()
public MailServerType Type
}
When one of the properties of the current mail server changed i would like
that the application will set it.
I know of course that I can add
OnPropertyChanged(PropertyName,PropertyValue) to the IMailServer
but I am looking for other way.
I was thinking about reflection,but can I get the concrete class from an
interface?
Thanks in advance
In general my question is how can I set properties on a concrete class
while programming against interfaces
For example I have a MailServerFatory which can create two types of
Mail servers and return IMailServer
public interface IMailServer
{
void Send();
MailServerType Type {get;}
}
the first is SMTP server
public class SMTPMailServer : IMailServer
{
public void Send(){}
public string SMTPHost
public MailServerType Type
}
The second is EXCHMailServer
public class EXCHMailServer:IMailServer
{
public string UserName
public string PassWord
public string Folder
public void Send()
public MailServerType Type
}
When one of the properties of the current mail server changed i would like
that the application will set it.
I know of course that I can add
OnPropertyChanged(PropertyName,PropertyValue) to the IMailServer
but I am looking for other way.
I was thinking about reflection,but can I get the concrete class from an
interface?
Thanks in advance