Click here to Skip to main content
15,910,661 members
Home / Discussions / C#
   

C#

 
GeneralRe: Progressive tax calculator in C# Pin
Paul Conrad10-Oct-12 7:33
professionalPaul Conrad10-Oct-12 7:33 
QuestionC# obtain return code from a proxy Pin
dcof10-Oct-12 2:23
dcof10-Oct-12 2:23 
AnswerRe: C# obtain return code from a proxy Pin
dojohansen10-Oct-12 3:06
dojohansen10-Oct-12 3:06 
GeneralRe: C# obtain return code from a proxy Pin
Pete O'Hanlon10-Oct-12 3:08
mvePete O'Hanlon10-Oct-12 3:08 
GeneralRe: C# obtain return code from a proxy Pin
dojohansen10-Oct-12 5:52
dojohansen10-Oct-12 5:52 
GeneralRe: C# obtain return code from a proxy Pin
dcof10-Oct-12 16:00
dcof10-Oct-12 16:00 
GeneralRe: C# obtain return code from a proxy Pin
dojohansen10-Oct-12 23:33
dojohansen10-Oct-12 23:33 
QuestionRender Excel document to word document using C#.net Pin
Ullas_Joseph9-Oct-12 22:35
Ullas_Joseph9-Oct-12 22:35 
AnswerRe: Render Excel document to word document using C#.net Pin
Marco Bertschi12-Oct-12 5:03
protectorMarco Bertschi12-Oct-12 5:03 
QuestionSheet name is missing when doing a "SAve As" for Excel document to PDF Pin
Ullas_Joseph9-Oct-12 21:24
Ullas_Joseph9-Oct-12 21:24 
AnswerRe: Sheet name is missing when doing a "SAve As" for Excel document to PDF Pin
Pete O'Hanlon9-Oct-12 22:55
mvePete O'Hanlon9-Oct-12 22:55 
QuestionC# exclude file from directory search Pin
classy_dog9-Oct-12 17:51
classy_dog9-Oct-12 17:51 
AnswerRe: C# exclude file from directory search Pin
n.podbielski9-Oct-12 21:00
n.podbielski9-Oct-12 21:00 
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 

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.