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

C#

 
GeneralRe: received data by UDP client Pin
hasan hadi9-May-15 3:38
hasan hadi9-May-15 3:38 
GeneralRe: received data by UDP client Pin
F-ES Sitecore9-May-15 7:05
professionalF-ES Sitecore9-May-15 7:05 
GeneralRe: received data by UDP client Pin
hasan hadi9-May-15 7:42
hasan hadi9-May-15 7:42 
GeneralRe: received data by UDP client Pin
F-ES Sitecore9-May-15 7:48
professionalF-ES Sitecore9-May-15 7:48 
GeneralRe: received data by UDP client Pin
hasan hadi9-May-15 8:07
hasan hadi9-May-15 8:07 
AnswerRe: received data by UDP client Pin
Dr Gadgit10-May-15 5:03
Dr Gadgit10-May-15 5:03 
Question(solved) shorter syntax for invoking static methods in generic non-static class ? Pin
BillWoodruff7-May-15 20:41
professionalBillWoodruff7-May-15 20:41 
AnswerRe: shorter syntax for invoking static methods in generic non-static class ? Pin
Sascha Lefèvre7-May-15 22:31
professionalSascha Lefèvre7-May-15 22:31 
Hi Bill,

not sure if I'm missing your point - but why don't you do something like this?:
C#
public enum GatherMode
{
    Values,
    Names
}

public class TestClass : IEquatable<TestClass>
{ }

public static class NodeExtensions
{
    public static Dictionary<int, List<int>> Gather<T>(this Node<T> node, GatherMode gathermode, Func<Node<T>, Node<T>, bool> customfunc = null)
        where T : IEquatable<T>
    {
        if (func == null)
            func = (n1, n2) => n1.GatherFunc<T>(n2);

        return null;
    }

    public static bool GatherFunc<T>(this Node<T> node, Node<T> otherNode)
        where T : IEquatable<T>
    {
        return true;
    }
}

public class Node<T> : IEquatable<Node<T> where T : IEquatable<T>
{
    private void test()
    {
        var XNode = new Node<TestClass>();

        var result1 = XNode.Gather(GatherMode.Values);
        var result2 = XNode.Gather(GatherMode.Names);
    }
}

/Sascha
If the brain were so simple we could understand it, we would be so simple we couldn't. — Lyall Watson

GeneralRe: shorter syntax for invoking static methods in generic non-static class ? Pin
BillWoodruff7-May-15 22:46
professionalBillWoodruff7-May-15 22:46 
GeneralRe: shorter syntax for invoking static methods in generic non-static class ? Pin
Sascha Lefèvre7-May-15 23:53
professionalSascha Lefèvre7-May-15 23:53 
GeneralRe: shorter syntax for invoking static methods in generic non-static class ? Pin
BillWoodruff8-May-15 0:40
professionalBillWoodruff8-May-15 0:40 
GeneralRe: shorter syntax for invoking static methods in generic non-static class ? Pin
Sascha Lefèvre8-May-15 5:27
professionalSascha Lefèvre8-May-15 5:27 
SuggestionRe: shorter syntax for invoking static methods in generic non-static class ? Pin
Richard Deeming8-May-15 0:42
mveRichard Deeming8-May-15 0:42 
Questionhow do I get datasource to put to any drive c# Pin
Member 97020587-May-15 14:19
Member 97020587-May-15 14:19 
AnswerRe: how do I get datasource to put to any drive c# Pin
Dave Kreskowiak7-May-15 16:50
mveDave Kreskowiak7-May-15 16:50 
AnswerRe: how do I get datasource to put to any drive c# Pin
OriginalGriff7-May-15 20:35
mveOriginalGriff7-May-15 20:35 
AnswerRe: how do I get datasource to put to any drive c# Pin
Richard Deeming8-May-15 0:35
mveRichard Deeming8-May-15 0:35 
QuestionHow to run a setup file in different sysytem.. Pin
Jayamanickam7-May-15 2:32
Jayamanickam7-May-15 2:32 
AnswerRe: How to run a setup file in different sysytem.. Pin
OriginalGriff7-May-15 3:10
mveOriginalGriff7-May-15 3:10 
GeneralRe: How to run a setup file in different sysytem.. Pin
Brisingr Aerowing7-May-15 4:21
professionalBrisingr Aerowing7-May-15 4:21 
GeneralRe: How to run a setup file in different sysytem.. Pin
ZurdoDev7-May-15 6:00
professionalZurdoDev7-May-15 6:00 
QuestionRe: How to run a setup file in different sysytem.. Pin
ZurdoDev7-May-15 4:06
professionalZurdoDev7-May-15 4:06 
QuestionC# web browser Pin
Jonteepersson967-May-15 1:56
Jonteepersson967-May-15 1:56 
GeneralRe: C# web browser Pin
Sascha Lefèvre7-May-15 2:04
professionalSascha Lefèvre7-May-15 2:04 
GeneralRe: C# web browser Pin
Jonteepersson967-May-15 2:13
Jonteepersson967-May-15 2:13 

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.