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

C#

 
AnswerRe: How can I make IE window blank for a specific url? Pin
Christian Graus2-Jun-09 20:23
protectorChristian Graus2-Jun-09 20:23 
QuestionToolbar developmet for internet explorer Pin
pithyvishal2-Jun-09 17:51
pithyvishal2-Jun-09 17:51 
QuestionHow to generate odbcDataAdapter.TableMappings? Pin
Morven Huang2-Jun-09 17:18
Morven Huang2-Jun-09 17:18 
QuestionHow to design a web spider Pin
Fired.Fish.Gmail2-Jun-09 16:45
Fired.Fish.Gmail2-Jun-09 16:45 
AnswerRe: How to design a web spider Pin
Mycroft Holmes2-Jun-09 16:57
professionalMycroft Holmes2-Jun-09 16:57 
GeneralRe: How to design a web spider Pin
Fired.Fish.Gmail15-Jun-09 19:16
Fired.Fish.Gmail15-Jun-09 19:16 
QuestionHow to receiving an incoming SMS message? in C# Pin
Md. Ali Naser Khan2-Jun-09 16:07
Md. Ali Naser Khan2-Jun-09 16:07 
AnswerRe: How to receiving an incoming SMS message? in C# Pin
Christian Graus2-Jun-09 16:11
protectorChristian Graus2-Jun-09 16:11 
GeneralRe: How to receiving an incoming SMS message? in C# Pin
Md. Ali Naser Khan2-Jun-09 16:58
Md. Ali Naser Khan2-Jun-09 16:58 
GeneralRe: How to receiving an incoming SMS message? in C# Pin
Christian Graus2-Jun-09 18:20
protectorChristian Graus2-Jun-09 18:20 
AnswerRe: How to receiving an incoming SMS message? in C# Pin
Giorgi Dalakishvili2-Jun-09 19:53
mentorGiorgi Dalakishvili2-Jun-09 19:53 
QuestionFastest way to scan an image for pixel color (black and white) Pin
sebogawa2-Jun-09 15:41
sebogawa2-Jun-09 15:41 
AnswerRe: Fastest way to scan an image for pixel color (black and white) Pin
Luc Pattyn2-Jun-09 15:54
sitebuilderLuc Pattyn2-Jun-09 15:54 
GeneralRe: Fastest way to scan an image for pixel color (black and white) Pin
sebogawa2-Jun-09 16:12
sebogawa2-Jun-09 16:12 
GeneralRe: Fastest way to scan an image for pixel color (black and white) Pin
Alan Balkany3-Jun-09 5:03
Alan Balkany3-Jun-09 5:03 
QuestionBottom-Up Datagrid Pin
eziksoft2-Jun-09 15:17
eziksoft2-Jun-09 15:17 
AnswerRe: Bottom-Up Datagrid Pin
Mycroft Holmes2-Jun-09 17:03
professionalMycroft Holmes2-Jun-09 17:03 
GeneralRe: Bottom-Up Datagrid Pin
eziksoft3-Jun-09 5:28
eziksoft3-Jun-09 5:28 
GeneralRe: Bottom-Up Datagrid Pin
Mycroft Holmes3-Jun-09 14:18
professionalMycroft Holmes3-Jun-09 14:18 
GeneralRe: Bottom-Up Datagrid Pin
eziksoft3-Jun-09 14:20
eziksoft3-Jun-09 14:20 
Questionabout the interface of C# Pin
mctramp1682-Jun-09 14:24
mctramp1682-Jun-09 14:24 
AnswerRe: about the interface of C# Pin
Christian Graus2-Jun-09 14:52
protectorChristian Graus2-Jun-09 14:52 
AnswerRe: about the interface of C# Pin
Richard Blythe2-Jun-09 16:15
Richard Blythe2-Jun-09 16:15 
I'm assuming like Christian that your question is about using interfaces in your own classes. Interfaces do not offer any significant performance benefit. However, they are very useful in situations where classes do inherit from the same base type. Here's a quick example of using interfaces:

public class SecretService : ISecurityCleared
....

public class CIA : ISecurityCleared
...

public class President : ISecurityCleared
...




//ISecurityCleared interface...

public interface ISecurityCleared
{
void ViewTopSecretMessage(string message);
}


//sample code...

private void TopSecretMessage(string topsecretmessage)
{
List<ISecurityCleared> securityCleared = new List<ISecurityCleared>();
securityCleared.Add(new SecretService());
securityCleared.Add(new CIA());
securityCleared.Add(new President());

for (int i = 0; i < securityCleared.Count; i++)
securityCleared.ViewTopSecretMessage(topsecretmessage);

}

Again, no performance increase, just cleaner code without having to worry about inheritance issues.

Cheers,
Richard

There cannot be a crisis today; my schedule is already full.

GeneralRe: about the interface of C# Pin
EliottA3-Jun-09 2:55
EliottA3-Jun-09 2:55 
GeneralRe: about the interface of C# Pin
Richard Blythe3-Jun-09 4:51
Richard Blythe3-Jun-09 4: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.