Click here to Skip to main content
15,886,026 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# exclude file from directory search Pin
OriginalGriff9-Oct-12 21:07
mveOriginalGriff9-Oct-12 21:07 
QuestionHow to draw on web page? Pin
dfernando229-Oct-12 9:31
dfernando229-Oct-12 9:31 
AnswerRe: How to draw on web page? Pin
Pete O'Hanlon9-Oct-12 9:54
mvePete O'Hanlon9-Oct-12 9:54 
GeneralRe: How to draw on web page? Pin
dfernando229-Oct-12 10:29
dfernando229-Oct-12 10:29 
GeneralRe: How to draw on web page? Pin
Pete O'Hanlon9-Oct-12 10:35
mvePete O'Hanlon9-Oct-12 10:35 
GeneralRe: How to draw on web page? Pin
y.dsandeepnaidu9-Oct-12 20:11
y.dsandeepnaidu9-Oct-12 20:11 
GeneralRe: How to draw on web page? Pin
Pete O'Hanlon10-Oct-12 0:43
mvePete O'Hanlon10-Oct-12 0:43 
SuggestionCompare Types Question Pin
Kevin Marois9-Oct-12 7:18
professionalKevin Marois9-Oct-12 7:18 
I'm working with an Infragistics UltraTree. The types loaded into the tree are each stored on the node's Tag property. I want to activate a node based on a particular instance of a type.

So far I have:

public void SelectNodeByEntity<T>(T Entity)
{
    UltraTreeNode node = GetNode(UltraTree1.Nodes, Entity);

    if (node != null)
    {
        UltraTree1.ActiveNode = node;
    }
}
private UltraTreeNode GetNode<T>(TreeNodesCollection Nodes, T Entity)
{
    UltraTreeNode retVal = null;

    foreach (UltraTreeNode node in Nodes)
    { 
        var entity = (T)node.Tag;

        if (entity == Entity)    //<====== Doesn't compile.
        {
            return node;
        }
        else
        {
            if (node.Nodes.Count > 0)
            {
                return GetNode<T>(node.Nodes, Entity);
            }
        }
    }

    return retVal;
}


But it won't compile on the line indicated above with "Operator '==' cannot be applied to operands of type 'T' and 'T'".

How do I pull the object off the tag, convert it to type T and compare it with the type passed in to see if their the same?

Thanks
If it's not broken, fix it until it is

GeneralRe: Compare Types Question Pin
Pete O'Hanlon9-Oct-12 7:27
mvePete O'Hanlon9-Oct-12 7:27 
GeneralRe: Compare Types Question Pin
Kevin Marois9-Oct-12 7:31
professionalKevin Marois9-Oct-12 7:31 
GeneralRe: Compare Types Question Pin
Pete O'Hanlon9-Oct-12 7:55
mvePete O'Hanlon9-Oct-12 7:55 
GeneralRe: Compare Types Question Pin
dojohansen10-Oct-12 3:12
dojohansen10-Oct-12 3:12 
GeneralRe: Compare Types Question Pin
BobJanova10-Oct-12 0:35
BobJanova10-Oct-12 0:35 
QuestionRe: Compare Types Question Pin
DaveyM6910-Oct-12 1:06
professionalDaveyM6910-Oct-12 1:06 
AnswerRe: Compare Types Question Pin
BobJanova10-Oct-12 1:45
BobJanova10-Oct-12 1:45 
QuestionWeka To C# Problems Pin
kimo_4u9-Oct-12 5:24
kimo_4u9-Oct-12 5:24 
SuggestionRe: Weka To C# Problems Pin
Richard MacCutchan9-Oct-12 5:31
mveRichard MacCutchan9-Oct-12 5:31 
GeneralRe: Weka To C# Problems Pin
kimo_4u9-Oct-12 5:33
kimo_4u9-Oct-12 5:33 
GeneralRe: Weka To C# Problems Pin
Pete O'Hanlon9-Oct-12 5:36
mvePete O'Hanlon9-Oct-12 5:36 
GeneralRe: Weka To C# Problems Pin
kimo_4u9-Oct-12 5:39
kimo_4u9-Oct-12 5:39 
GeneralRe: Weka To C# Problems Pin
Pete O'Hanlon9-Oct-12 5:45
mvePete O'Hanlon9-Oct-12 5:45 
GeneralRe: Weka To C# Problems Pin
Paul Conrad10-Oct-12 7:36
professionalPaul Conrad10-Oct-12 7:36 
QuestionMessage Closed Pin
9-Oct-12 4:59
sayem_sam9-Oct-12 4:59 
AnswerRe: gfhfgh Pin
Pete O'Hanlon9-Oct-12 5:02
mvePete O'Hanlon9-Oct-12 5:02 
SuggestionRe: gfhfgh Pin
Eddy Vluggen9-Oct-12 5:14
professionalEddy Vluggen9-Oct-12 5:14 

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.