.net

Where can I find a good documentation example?

I am looking for a good example of documentation of an API (coded in C#) where structures are well documented. Should include: Delegates Events Enums class struct Right now, I am searching through http://code.google.com, but so far I have not found anything self explanatory. ...

How can I create .chm files from C# code?

I used Doxygen to create HTML files, now I want to convert that documentation into .chm format. How can I do this? ...

Any solution or workaround to serializing SQLParameter in WCF?

I originally defined in my MessageContract a collection of SQLParameters in order to create a simple stored procedure execution through a WCF service. Apparently, SQLParameter is not serializable, so I need some advice on how to proceed here. Is it possible to still somehow use SQLParameter as part of my WCF contract, or I have to do so...

How to write a tool, inverting colors in Windows?

I read a topic in this site about it, but decided to post another one as I want to write such a tool, but I don't have much experience in C# & .NET, so it could take me too much time just digging the Net, while someone can just direct me to the right library or classes to be used. So, straight to the point. I want to write a tool that, ...

Adding object to the begining of generic List<T>

Add method Adds an object to the end of the List<T> What would be a quick and efficient way of adding object to the beginning of a list ...

64 bit smpp library for .net

I'm currently using the devshock smpp library. unfortunatly it only appears to be available in 32 bit binaries. Does anyone know if they do a 64 bit version or if there is anywhere that does a decent 64-bit smpp library?? ...

Socket-Programming

Ok guys I've racked my little brain and have been unable to find a solution. The problem here is that I am being able to call begin-receive once, but after that I am unable to find a proper technique by which the method can be called again and again. Consequently although a connection is being made,messages can be received just once and ...

Storing DLL's in A Central NON GAC Location

We are being presented with a unique, painful situation. Traditionally we have been using the GAC and Policy Files to control DLL versions for our .NET applications. However, we have a very unique situation and are running into major problems with this, as some of our applications do NOT respect the policy files. Most specifically the...

Where to check if an object is null or not?

Where do you check if an object that you are passing to a method is null or not? Should an object need to be tested before calling a method? or within the method that is using the argument? public class Program { public static void Main(string[] args) { // Check if person is null here? or within PrintAge? Print...

Writing long test method names to describe tests vs using in code documentation

For writing unit tests, I know it's very popular to write test methods that look like public void Can_User_Authenticate_With_Bad_Password() { ... } While this makes it easy to see what the test is testing for, I think it looks ugly and it doesn't display well in auto-generated documentation (like sandcastle or javadoc). I'm interest...

.NET: How to convert a windows form to a windows control

I have a a .NET 3.5 windows form which I'd like to embed into another form. Is there a quick way to turn that form into a control? Thanks ...

Conventions for immutable objects

When you design immutable classes, do you prefer: Layer.ColorCorrect ( layer ) or layer.ColorCorrect ( ) To me #1 seems more intuitive, instead of #2, which looks like it modifies the object that's referenced, since it's an instance method, it might as well change the internals, right? ...

What are the implications of using unsafe code

Aside from the fact that the code itself can access memory directly. What are the other implications of using the "/unsafe" compiler flag and the "fixed" keyword? Are there any knock on effects related to code signing and deployment of my .exe (my app is desktop only)? (This isn't about whether or not I should be doing this, the why is ...

What do you think of my IDisposable pattern implementation?

What do you think of the following IDisposable pattern implementation? public class Connection : IDisposable { private Socket _socket; public bool IsConnected() { if (_socket.Poll(1, SelectMode.SelectRead) && _socket.Available == 0) return false; return true; } public void Disconnect() ...

What can cause a WPF application to crash with an AppHangB1 Problem Event Name?

The program I'm currently working on occasionally hangs with an AppHangB1 problem event. I have traced it to a specific series of actions, but it seems to be a type of heisenbug, as whenever I step through the code, it doesn't manifest itself. And once the program hangs, I can't pause the program to see where it is hung in Visual Studi...

Linq To Sql - Update not being persisted.

I am really confused about why an update is not taking place. This is very simple: int goodID = 100; DataContext db = new DataContext(); Schedule schedule = db.Schedules.Single(s => s.ID == goodID); // this wont persist - WHY NOT?! schedule.Email = txtEmail.Text; // this does persist schedule.NumberCourse...

Why does the compiler require convoluted syntax for this?

Or, "am I doing it wrong"? I am writing a small function that will return a string, quoted (as quoted-printable) if necessary, otherwise it returns it as is. A character is input into the function; the result is a string. What I tried to do at first was: private string QuotedChar(char ch) { if(ch < (char)128 && !char.IsWhiteSpace...

How do I call system code from JScript/VBScript?

I have a C# app that uses a web browser control to display some HTML and do some JScript in the background. How do I integrate this with other system calls? Do I call other C# code from JScript/VBScript? Do I need to do it from the form itself? ...

Property grid only show some category

I got a PropertyGrid that is use on an object that have the following property category : Style, Calcul and Misc What I want is to only show to the user the Calcul category, but I don't want to use the browsable attribute because I want all these property to be visible in Visual studio. So, what I need, is an in-code solution. I use ....

.Net PropertyGrid Thread-safety

I have a PropertyGrid in my application that is used for editing arbitrary objects. I need to be able to run an arbitrary subroutine on another thread that also looks at these objects (search functionality, if you're curious). The obvious issue is that a user could be editing one of these objects at the same time my search thread is re...