Click here to Skip to main content
16,007,163 members
Home / Discussions / C#
   

C#

 
QuestionListener Pin
shuahsan24-Jan-09 17:28
shuahsan24-Jan-09 17:28 
AnswerRe: Listener Pin
SeMartens25-Jan-09 1:05
SeMartens25-Jan-09 1:05 
QuestionSNMP Pin
shuahsan24-Jan-09 17:26
shuahsan24-Jan-09 17:26 
QuestionGenerics - casting int/double to <t></t> Pin
devvvy24-Jan-09 17:24
devvvy24-Jan-09 17:24 
AnswerRe: Generics - casting int/double to Pin
DaveyM6924-Jan-09 22:19
professionalDaveyM6924-Jan-09 22:19 
AnswerRe: Generics - casting int/double to Pin
S. Senthil Kumar24-Jan-09 22:54
S. Senthil Kumar24-Jan-09 22:54 
GeneralRe: Generics - casting int/double to Pin
devvvy25-Jan-09 14:12
devvvy25-Jan-09 14:12 
AnswerRe: Generics - casting int/double to Pin
DaveyM6924-Jan-09 22:57
professionalDaveyM6924-Jan-09 22:57 
The generic interface method does work.
IRand<int> intVersion = new Rand(); ;
Console.WriteLine(intVersion.GetNext(1, 2, new List<int>()));
IRand<long> longVersion = new Rand(); ;
Console.WriteLine(longVersion.GetNext(1, 2, new List<long>()));
public interface IRand<T>
{
    T GetNext(T min, T max, List<T> exclude);
}

public class Rand : IRand<int>, IRand<long>
{
    public int GetNext(int min, int max, List<int> exclude)
    {
        int result = 0;
        // do stuff
        return result;
    }

    #region IRand<long> Members

    public long GetNext(long min, long max, List<long> exclude)
    {
        long result = 0;
        // do stuff
        return result;
    }

    #endregion
}


Dave
BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)

GeneralRe: Generics - casting int/double to Pin
devvvy25-Jan-09 14:10
devvvy25-Jan-09 14:10 
GeneralRe: Generics - casting int/double to Pin
DaveyM6926-Jan-09 0:15
professionalDaveyM6926-Jan-09 0:15 
Questiondata gridview problem Pin
bfis10813724-Jan-09 14:01
bfis10813724-Jan-09 14:01 
AnswerRe: data gridview problem Pin
paas25-Jan-09 6:17
paas25-Jan-09 6:17 
QuestionCan any one help please? Pin
Member 284246824-Jan-09 13:52
Member 284246824-Jan-09 13:52 
AnswerRe: Can any one help please? Pin
Not Active24-Jan-09 16:52
mentorNot Active24-Jan-09 16:52 
AnswerRe: Can any one help please? Pin
Christian Graus25-Jan-09 0:44
protectorChristian Graus25-Jan-09 0:44 
AnswerRe: Can any one help please? Pin
Guffa25-Jan-09 2:37
Guffa25-Jan-09 2:37 
GeneralRe: Can any one help please? Pin
NikoTanghe26-Jan-09 3:44
NikoTanghe26-Jan-09 3:44 
GeneralRe: Can any one help please? Pin
Guffa26-Jan-09 3:49
Guffa26-Jan-09 3:49 
QuestionGet html from url Pin
macsheriff24-Jan-09 8:00
macsheriff24-Jan-09 8:00 
AnswerRe: Get html from url Pin
Guffa24-Jan-09 8:44
Guffa24-Jan-09 8:44 
GeneralRe: Get html from url Pin
macsheriff24-Jan-09 9:03
macsheriff24-Jan-09 9:03 
GeneralRe: Get html from url Pin
Guffa24-Jan-09 11:42
Guffa24-Jan-09 11:42 
GeneralRe: Get html from url Pin
macsheriff25-Jan-09 4:19
macsheriff25-Jan-09 4:19 
GeneralRe: Get html from url Pin
Guffa25-Jan-09 13:57
Guffa25-Jan-09 13:57 
Questionadd a row to tableLayoutPanel at runtime VS 2005 Pin
lcm124-Jan-09 6:29
lcm124-Jan-09 6:29 

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.