At first you should ask how its avoided to detect a proxy to later try to find out programmatically.
To detect a proxy there are more possibilities.
One mayor detection is based on the request headers sent from the proxy.
This means that e.g. the "via" and the "forwarded" and "follow_x.." headers should be deactivated.
E.g. if you configure it as a transparent, it passes your (another) IP to the server.
Then there are blacklists who filter datacenters. So if you rent a cheap datacenter vps, install a squid proxy, you maybe still marked as proxy. This is why there are sold many "residental" proxies coming from ISP ranges.
So if you want to detect via C# you should consider to filter by request headers.
(The attempt would be to do a request and catch the request, analyse/filter headers via C#)
http://www.whatismyproxy.com/
This is a good page to get information about your using proxy.
Hope I could help a bit.
GER/EN/FR