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

C#

 
AnswerRe: Progressive tax calculator in C# Pin
Pete O'Hanlon10-Oct-12 3:05
mvePete O'Hanlon10-Oct-12 3:05 
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 
I'm not sure what you mean by that. It should "expose" the return value *as* a return value. Externally, it's useage should be identical to your original proxy, but internally it should call the proxy, update tracking information, and return whatever the proxy returned.

Perhaps we are talking past one another. What I mean is you have some generated proxy like this:

C#
class Proxy
{
    public int Foo()
    {
        // ...
    }
}


and some code that uses it,

C#
class UserCode
{
    void Bar()
    {
        var x = new Proxy().Foo();
    }
}


You can now introduce a "metaproxy",

C#
class MetaProxy
{
    int clientID;
    Proxy proxy = new Proxy();

    public MetaProxy(int clientID)
    {
        this.clientID = clientID;
    }

    public int Foo()
    {
        var x = proxy.Foo();
        Tracking.Register("Foo", clientID, x);
        return x;
    }
}


Lastly of course the user code must be modified to use MetaProxy instead of Proxy.

I don't know the details of what sort of tracking you really need to do. Nor do I know, or want to know Smile | :) , everything needed to say if this is how you should obtain the information you need (examplified by "clientID"). If you have this information everywhere you are making such calls, perhaps this is a good way of doing it. If you don't, and this is in an application processing requests (so that everything that happens in a thread happens on behalf of a particular client) perhaps it'd be nice to put the clientID in a ThreadStatic instead, and then your MetaProxy could just have a default constructor and sniff out the clientID from there.

So you still have to do your own thinking. But hopefully this will make it clear how I propose you can establish tracking. Of course just keeping track of things is not going to do anything more than that.
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 
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 

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.