.net

Why does .NET read values of unaffected properties on reception of INotifyPropertyChanged.PropertyChanged event?

Hi everyone! I'm new to data binding and encountered the following oddity today which I fail to understand: I have a form with two labels (labelA and labelB) and two buttons (buttonA and buttonB). The form hosts an object (called "formState") with two properties (CountA and CountB). labelA.Text is data-bound to formState.CountA, labelB...

What is the fastest serialization method for .net?

I'm trying to serialize data that's about 30KB and I need to find a faster way to serialize/deserialze the data. For me speed is as important as size so either I find a way to compact the data more tightly or I need to have a faster mechanism to build the objects. I've tried building some custom methods for it as well as using the buil...

Converting asp.net/sql web app to be ime zone savy

Our current app stores all dates via the server's datetime. I'm thinking we need to update all datetime values in the database over to UTC time. Now for displaying these dates back to the user, I know .Net 3.5 has datatypes that are specific to date time offsets. But does anyone see anything wrong with setting an application variable...

Convert PHP encryption code to C#

Hi, I'm trying to convert this piece of code from PHP to C#. It's part of a Captive Portal. Could somebody explain what it does? $hexchal = pack ("H32", $challenge); if ($uamsecret) { $newchal = pack ("H*", md5($hexchal . $uamsecret)); } else { $newchal = $hexchal; } $response = md5("\0" . $password . $newchal); $new...

ADO.NET Entity Framework Association of Entities by Value Range

I have two EF entities. One has a property called HouseNumber. The other has two properties, one called StartHouseNumber and one called EndHouseNumber. I want to create a many to many association between these elements based on whether or not HouseNumber falls between StartHouseNumber and EndHouseNumber. However, I can only seem to get ...

Anyone feel like passing it forward?

I'm the only developer in my company, and am getting along well as an autodidact, but I know I'm missing out on the education one gets from working with and having code reviewed by more senior devs. Does anyone know of any sites/resources that provide volunteer mentors? I'm looking for some one to review my code from time to time and g...

Manually implementing high performance algorithms in .NET

As a learning experience I recently tried implementing Quicksort with 3 way partitioning in C#. Apart from needing to add an extra range check on the left/right variables before the recursive call, it appears to work quite well. I knew beforehand that the framework provides a built-in Quicksort implementation in List<>.Sort (via Array....

How do I update a single table of a DataSet using a TableAdapter, without hard-coding the table name?

This seems like a really basic thing that I'm doing, yet I'm tearing my hair out trying to make it work. My situation is this: I have a project which contains a large number of lookup tables, and I have all of these lookup tables represented in a single typed DataSet, which contains TableAdapters for each lookup. I've designed an edito...

Create Setup package runtime in .NET

I want to create one application which created Setup file for Window Desktop application runtime with all resource file which application needed. Is this possible? If yes then how I can do this? ...

Where is the ToObservable extension method?

I see it mentioned here, but I can't work out which using I have to add to get it. (Rolled my own for the moment) ...

WCF Disable Deserialization Order Sensitivity

I have a recurring problem when passing Serialized objects between non-.NET Clients, and .NET WCF Services. When WCF Deserializes objects, it is strictly dependant upon the order of properties. That is, if I define my class as: public class Foo { public int ID { get; set; } public int Bar { get; set; } } Then WCF Will ser...

Start a program in active user session with PowerShell remoting

Is it possible to detect that a specific user has an open session on a computer and to open a process in that session so that the application can be interacted with by the user using PowerShell remoting? How would I go around detecting which users have sessions open on the machine and what their state is (active, idle, disconnected, etc...

is there a servicebus solution where consumers don't consume events? (multiple consumers receive same event)

Hi, I was reading up on ActiveMQ which seems like a great implementation of a servicebus where producers can post messages and other processes can receive them. However when reading the documentation, it looks like the producer has to give the 'endpoint' when sending a message. I would rather have it the other way around: My producer ...

What is the most efficient way to create a distinct list of items using .NET?

I have a large list of values (100-200 character strings) and I need to return a distinct listing of them. What is the most efficient way to do this using .NET? The 2 ways that I can think of are: Use the Distinct() method of the IEnumerable class Use a Dictionary If the Dictionary approach is faster in raw terms, consider a trade-...

how to filter out DateTime type of values from all hashtable value?

I need to convert all DateTime values to String, though out my project, all of my code at the end follows 1 function, where I have 4 different Hashtables (actually XmlRpcStruct Object of CookComputing xmlrpc library). is there any way that without iterating on each hash table - I can convert the values of hashtable having datetime -> st...

Linq Lookup dynamic list

Hi, I have a List of objects (string filename, BitmapImage image) to use as a cache of images. private static readonly List<ImageData> imageCache = new List<ImageData>(); I created a Lookup to check this cache for an image each time it is required. If the image is not in the list it is added to the list. The Looked is statically cre...

Keep alive using SIP in .net

I am creating an application where I need to implement SIP protocol in .NET. We have Client-Server setup where client keeps on sending keep alive message to server. We can only use SIP protocol or any other protocol which is support with ICE. Could some one help me in implementing this. I don't have much idea about these protocols but I...

WSE 3.0 cookies support?

Hi, I'm trying to call a web service with WSE 3.0 which uses cookies for authentication. With standard SoapHttpClientProtocol, I could assign my CookieContainer to a request. However, WSE 3.0 web services does not directly or indirectly inherit from it. How can I set cookies to WSE 3.0 request? ...

can you use castle dynamic proxies on web services references?

Hi, Is it possible to create a dynamic proxy on the a web service reference that has been added to a visual studio project? I've added the web service reference in the normal way and tried to create a dynamic proxy using castle to wrap the method invocation in a try/catch to translate any SoapExceptions, but on running it I'm getting a ...

Sending raw SOAP XML directly to WCF service from C#

I have a WCF service reference: http://.../Service.svc(?WSDL) and I have an XML file containing a compliant SOAP envelope <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt; <soapenv:Body> <MyXML> ... Now, I would like to send this raw data directly to the service (and receive the response) ...