.net

DevExpress eXpress Persistent Objects (XPO) via WCF

Hello all DevExpress devs! =) I'm trying to tame Express Persistent Objects remotely. Actually, XPO allows two different approaches - accessing the database directly, and through WebService/WCF. For security reasons, we've chosen second option. Now, WCF wraps database access, and clients must authenticate themselves in order to acce...

Does C# has impact when evaluating /parsing expressions?

Sometimes back I was trying the following statement in C# i+++++i // does not compile <bt> i++ + ++i // executed Does space has impact in expressions? In what way the above statements are different? Ramachandran ...

How to create a new Thread to execute an Action<T>

The title pretty much says it. I have some methods that need to run on a new thread and since all the code before creating the thread is pretty much the same, I thought I would create a function that could take as a parameter the Action I need to invoke. Problem is, I have not found how to tell the thread that it needs to execute the Ac...

Running WCF 3.5 app under .NET 4.0 website

I have a website that is hosted on IIS6 and set to use .NET 4.0, but I still have a WCF service on the site that is using 3.5. When i browse my svc file, i get the error: unrecognized attribute 'targetFramework' and it point to the websites root web.config. I have tried this MSDN article and still get the same error. My site is usi...

What to use instead of Interlocked.Equals

I have some legacy code that uses Interlocked.Equals to compare values. The values may be two bools or it may compare an array of structs to null. Resharper complains about Interlocked.Equals saying "access to a static member of a type via a derived type". I know that Equals is not a member of the Interlocked class, but rather is a mem...

Is Order of items read from a XDocument, by LINQ, Guaranteed?

So what I'm doing is using an xml document to determine the order in which certain SQL scripts need to be ran by a database update. The XML follows this format <ScriptRules> <Database databaseName = “string”> <Folder folderPath = “string” executeAllFiles = boolean> <file order=”first or last”>“Filename”</file> ...

WPF - Dialogs using MVVM

Hi! When using custom dialog windows in a MVVM application, do you think it´s Ok to use the code behind to handle properties, events etc.? Or should I always have a ViewModel binded to every dialog view? What´s your thought? ...

Frequent inserts into sorted collection.

I have sorted collection (List) and I need to keep it sorted at all times. I am currently using List.BinarySearch on my collection and then insert element in right place. I have also tried sorting list after every insertion but the performance in unacceptable. Is there a solution that will give better performance? Maybe I should use ot...

Which attribute to use in System.ComponentModel namespace for setting order of fields?

By default, the fields in the designer are listed in alphabetical order. Does anyone know which attribute to use in the System.ComponentModel namespace to set the order explicitly? ...

How can I provide a delegate in a managed interface class

Hello all, I am working on a project containing parts of C#, managed C++ as well as unmanaged C++ code. I am working with .NET 3.5. My programming experience lies more on the unmanaged C++ side an I am not that familiar with the concepts of .NET. My question is: How can I hide / provide a delegate behind a managed interface class. Su...

Propagation of events in a collection based project

I have a collection-based project in .NET 4. What I mean is that, I have a master collection, call it "System", which is made up of frames, which are each made up of cards, which are in turn made up of channels. So, it looks like System->Frame->Card->Channel. All these are represented as objects, and there is a Parent-Child relationship ...

2 Different Services with the Same Base Object

I have 2 services that one returns an object and a second service that takes that same object in as a paramater. Is it possible to do something like the following in .NET? From my understanding JAVA actually supports actions like this var personObject = Service1.GetPerson(); Service2.DeletePerson(personObject); Thank you for any assi...

How can I programmatically find the Windows Fax Personal CoverPages folder?

I'm trying to find the Windows Fax "Personal CoverPages" folder from my application. On my Win7 machine, it's C:\Users\USER\Documents\Fax\Personal CoverPages But Windows Fax also comes with XP and Vista Ultimate. I'm pretty sure their folders wouldn't be in the same place. Is there any way for me to find this folder from my C# code? ...

Differences between CAPICOM TripleDES and System.Security.Cryptography TripleDES

I'm trying to move away from using CAPICOM since I can no longer use it (64-bit Windows 7 machine). The existing code for using TripleDES is like this: EncryptedDataClass cryptic = new EncryptedDataClass(); cryptic.Algorithm.Name = CAPICOM_ENCRYPTION_ALGORITHM.CAPICOM_ENCRYPTION_ALGORITHM_3DES; cryptic.SetSecret(secretKey, CAPICOM_SECR...

how to get distinct records in datatable?

Hello everyone, I am using C# + VSTS 2008 + .Net + ASP.Net + IIS 7.0 + ADO.Net + SQL Server 2008. I have a ADO.Net datatable object, and I want to filter out duplicate/similar records (in my specific rule to judge whether records are duplicate/similar -- if record/row has the same value for a string column, I will treat them as duplicat...

.Net Async WebService call

I know all about threading applications, but haven't done this over web services before. Rather than have the client manage various threads, I want to just fire an async method and get the result from a callback. It looks straight forward enough - just call the async method in the proxy class generated by visual studio. BUT WAIT... ther...

Node graph editor

Anyone know where I can find a .net library for creating node graphs? Something that works like this, drag inputs on one to outputs on another. Regards _Eric ...

Access Win32/MFC "Stuff" from C#

There's a great code sample in this post: http://stackoverflow.com/questions/2399954/datetimepicker-automatically-move-to-next-datepart which shows how to clean up some of the behavior of the DateTimePicker in .NET. Unfortunately the code won't compile, since .NET can't understand the WM_KEYDOWN type stuff. I was able to google a...

The fastest GZIP decompress library in .NET

Which .NET library has the fastest decompress performance (in terms of throughput)? There are quite a few libraries out there... GZipStream DotNetZip Xceed Zip for .NET SevenZipLib SharpZipLib | community sponsor of Xceed Zip for .NET ...and I expect there are more I haven't listed. Has anyone seen a benchmark of the throughput pe...

Bandwidth Limits & HttpWebRequest

Is there any way to throttle a HttpWebRequest? I can call GetResponse() but that will download the response at it's own speed and I may want to limit the rate of download. So far I can't see anything that would let me? ...