.net

Pixel behaviour of FillRectangle and DrawRectangle

Hi, nearly every time I use Graphics.DrawRectangle or Graphics.FillRectangle (the int versions) I seem to miss the pixels on the right and bottom border of the rectangle I want to draw. What is the exact definition of which pixels get filled by Graphics.FillRectangle(brush,x,y,width,height) and Graphics.DrawRectangle(pen,x,y,width,...

Copying objects to 'this' object in C#

I have a certain hirerchy of classes that needs the capeability to copy all public properties from one object to another. Each class has a certain set of public properties that might differ from any other class. Example: class Base { // Common properties/methods... public void Copy<T>(T data) where T : Base { // ... } ...

dot net gridview sorting problem

Dear All, I have a web application (with C#). I have a GridView and want to be able to sort its contents. I have added the tags ... AllowSorting="True" onsorting="MyGridView_Sorting"> and asp:BoundField DataField="NAME" HeaderText="Name" SortExpression="NAME" inside the GridView. I have implemented the MyGridView_Sorting method...

GetHashCode with transient/persistent entities

Hiya, I'm implementing a layered supertype that all my entities will be based on. I am currently working on the Equity methods Equals and GetHashCode. I have the following for GetHashCode: public override int GetHashCode() { if (!_hashCode.HasValue) { if (this.Id.Equals(default(T))) { ...

.net mp3 converter library

Hi There, Does anyone know of any library to convert .caf files or .aif audio files to mp3 format. Im recording these on iPhone using AVAudioRecorder pibrary but need to convert them to mp3 on server side. Your help is much appreciated. Really stuck on this one. ...

Start learning DDD

I would like to start learning DDD. As .net developer, I found 3 interesting books for me. 1) Applying Domain Driven Design and Patterns With Examples in C Sharp and .NET (Jimmy Nilsson) 2) .NET Domain-Driven Design with C#: Problem - Design - Solution (Tim McCarthy) 3) Domain-Driven Design - Tackling Complexity in the Heart of Softwa...

XmlElement wrapped in extra tag in SOAP request

Hi I have a service-proxy with one method: void SendRequest(MyMessage msg); The MyMessage is defined as follows: [MessageContract(IsWrapped=false)] public class MyMessage{ [MessageBodyMember(Order=0)] public XmlElement Body; public MyMessage(XmlElement Body){ this.Body = Body; } } Now, the problem is that w...

Why is this class member leaving a SQL connection open?

Further to my recent questions, I've now closed most of the connections that our web application was leaving open. However, the connection created by the function below remains open. Can anyone identify why it is not closing? public DataTable GetSubDepartment(int deptId) { DataTable dt = new DataTable(); using (SqlConnection ...

Wait till a process ends

I've an application which does Process.Start() to start another application 'ABC'. I want to wait till that application ends (process dies) and continue my execution. How can i do it? There may be multiple instances of the application 'ABC' running at the same time. Any insights? ...

Partial class debugging

I have created a partial class for my xsd auto generated class. The problem is in debugging this partial class. Breakpoint are not recognized or the compiler doesn't break at the breakpoints set in the partial class. // Autogenerated class by xsd.exe public partial class Class1 { private Class1Brand[] brandField; private str...

Binding singleton to multiple services in Ninject.

Hi, I have a problem which seems very similar to the one described in http://markmail.org/message/6rlrzkgyx3pspmnf which is about the singleton actually creating more than a single instance if you're accessing it using different service types. I'm using the latest release of Ninject 2 for Compact Framework and the exact issue I'm havin...

Using IsSnapToTickEnabled but showing fewer ticks than TickFrequency

When using the WPF Slider, in order to get any kind of discrete functionality, you must set the IsSnapToTickEnabled property to true. However, the value you set for TickFrequency controls not only where the slider snaps, but also where the ticks are drawn. How do I go about snapping to every whole number (i.e. TickFrequency=1) but only h...

How can we retreive query string information in a ClickOnce Application?

Hi folks, I made a .NET Windows Forms application that I want to deploy using ClickOnce. However, I will need the application to retrieve the query string parameters passed to it. I found this MSDN article and followed its directions (select the check box labeled Allow URL parameters to be passed to application), but it doesn't appear ...

Difference between WCF rest starter kit and Web Application Toolkit for REST Services

Whats the difference between http://code.msdn.microsoft.com/WebAppToolkitREST and http://www.asp.net/downloads/starter-kits/wcf-rest? ...

Problems with AssemblyResolve event on created AppDomain

Hello, I am trying to customize the assembly resolution process by wrapping the AppDomain and its AssemblyResolve event inside a class. The simplified version of my ClassLoader is below. The problem I am having is that when the event AssemblyResolve is fired, it seems that I get a new instance of ClassLoader, not the one I previously c...

Form.Hide animation issue

I need to hide the main form in order to take a screenshot. I use Form.Hide(), but the method finishes executing while the animation still proceeds (on Windows 7). As a result, the screenshot contains a warped form image instead of no form at all. How to get around this issue? Form.VisibleChanged event has the same effect. ...

Built-in Generic Types

Hi, I read somewhere that EventHandler is a built-in generic type. Why is that so? Could somebody explain me ways to distinguish between generic and non-generic types? Thanks, Abhi. ================ I am reading Microsoft .NET Framework Application Development Foundation 2nd edition to prepare for MCTS. In the first chapter, there w...

Removing old versions of DLL from server

I have a problem where I have installed a DLL on a server into the GAC. When I try and uninstall it using the windows installer it still remains in the GAC. Is there anyway of removing this DLL completely from the GAC safely without affecting parts of the server/system? ...

XLIFF Library for .NET

Can anyone suggest some free .NET library that can be used for conversion HTML to XLIFF and back translated XLIFF to HTML? ...

Doesn't .NET 4.0 contain .NET 2.0?

Hello, I've encountered a strange problem. I've installed "Visual Studio 2010 ultimate". While installing it showed that it sucessfully installed .NET 4.0. While installing some other softwares. They complain that .NET 2.0 is missing and asking me to install it. How is it possible? .NET 4.0 must include .NET 2.0 right? EDIT: Now, I'm...