.net

How much information do pdb files contain? (C# / .NET)

Is is wise to redistribute the pdb files along with a commercial application? Occasionally, I'm using the stack trace to get a more detailed error reporting logs from the deployed applications; can this functionality be achieved without relying to those files? Also, how much hints of the original source code does these files contain? W...

Is there a good use for inout parameters?

IS there a good use for inout (ref in C#, byref (like out parameters) in vb.net) parameters in .NET? I feel that the confusion caused by a parameter used both as input and as a return value is worse that the increase in the number of parameters for out parameters, or returning an array or returning an custom class. ...

Providing Synchronous and Asynchronous Versions of Method in C#

I am writing an API in C# and I want to provide both synchronous and asynchronous versions of the publicly available methods. For example, if I have the following function: public int MyFunction(int x, int y) { // do something here System.Threading.Thread.Sleep(2000); return x * y; } how can I create an asynchronous version...

How do I limit my date range on an Ajax Calendar?

I am using the ajax calendar tool. I like its function, but I would like to restrict the user to an option of selecting a time frame starting with Today, and ending with 6 months prior. How do I do this? ...

C# _Click Event Casting Sender and Using FindControl

I have a _Click event that is firing when a chart is clicked on. In this event I immediately cast the sender to type Chart. I often follow this paradigm but feel icky each time that I do. In this particular instance I am also immediately running out to find a corresponding UpdatePanel so I can add a dynamically rendered GridView to it...

Is there a FireBug like utility for inspecting a Winform Application?

Howdy, I am designing a program that dynamically creates its own GUI at run time. I am looking for a firebug like utility that allows me to move my mouse around the form to see different controls highlighted and see what their size, padding, margins, etc are set to. Thank you, Keith ...

Generics or not Generics

Basically I have a custom List class that contains different fruits. Assume that each fruit has an ID number that is stored in the list. Is it better to have: new AppleList(); new OrangeList(); new LemonList(); or new FruitList<Fruit.Apple>(); new FruitList<Fruit.Orange>(); new FruitList<Fruit.Lemon>(); Things to consider: All I...

Help with enterprise library validation results

I'm trying to use Entlib 4's validation blocks but I'm running into a problem clearly identifying invalid properties in the validation results. In the following example, if the City property fails validation I have no way of knowing whether it was the City property of the HomeAddress object or the WorkAddress object. Is there a simple ...

How to copy one Graphics Object into another

I am trying to copy the contents of one graphics object to another, but the only was i have been able to find is based on using GDI32.DLL, which i would rather avoid using if possible. Does anyone know how/if this is possible using managed code? I dont mind if answers are in C# or VB.Net. Here is waht i currently have: Private Sub Co...

What is the 'page lifecycle' of an ASP.NET WebForm?

I'm looking to get a more thorough understanding of the ASP.NET page lifecycle. I'm in the process of building custom form controls and have found my knowledge in this area to be lacking. Are there any resources, tutorials, etc. that you've used to better understand this area? Are there any tools you've used to improve your knowledge i...

Group Totals in SPGridView

When I group items in a SPGridView using the GroupField property the grouping works great but the total row count does not show up like in a standard SharePoint list. Usually SharePoint will display the count next to the group in parenthesis (i.e. Group 1 (5)). Is there a way to enable this functionality. ...

Referencing a platform-specific library from a non-specific .NET app

I often need to include little bits of native code in my C# apps, which I tend to do via C++/CLI. Usually I just need to use a C++ library for which there exists no good alternative for .NET; but sometimes performance is a factor too. This is problematic; doing so means adding a reference to a specific x86 or x64 library. Most librari...

ViewState, UserControl and IsPostback

Basically, I have a drop down list and a dynamically added user control. The user control loads a grid view depending on the choice that was made in the drop down list. The drop down list is not part of the user control. Now, the question is, how do i simulate (isControlPostback = false) every time the user changes the selection in the ...

.net 2.0 IRC component

Anyone know of a good winforms IRC component? I don't want an IRC application, I want to be able to add IRC functionality to an existing windows form ...

FOSS HTML to PDF in Python, .Net or command line?

I have google as much as I possible, checked stackoverflow several times, and yet I can not find a good html to pdf converter that can handle css. Is there a free and open source solution (even for commercial usage)? There are many solutions, with huge variety of price ranges, but I was looking for something open source and free. I ha...

How to retrieve text value from a list box index in C#

listbox1.items[0].tostring(); its the command for getting the text value of item at 0th index but i have some list boxes in my form which are data bound to a sql database table.When ever i use this command it gives me (System.Data.DataRowView) as a string as output regardless of the actual text value of the listbox item at 0th index.Plz...

C# Threading Patterns - is this a good idea?

I was playing with a project of mine today and found an interesting little snippet, given the following pattern, you can safely cleanup a thread, even if it's forced to close early. My project is a network server where it spawns a new thread for each client. I've found this useful for early termination from the remote side, but also from...

In my WPF project installer, how do I bundle the .NET3.5 installer?

I developed some WPF projects, but I met a very serious issue. As you know, the .Net 3.5 installation is a pain (huge and relying on internet access). This is a problem on when we ship my product. Is there a way to bundle the redistribution part only? ...

What is the best way to encapsulate Linq to SQL data access?

I've been trying to encapsulate the object mapping in a projects data repository. Perhaps EF will provide the level of abstraction required but for a range of reasons I am using Linq to SQL at the moment. The following code aims to return the users in the database as a list of ModUser objects, where ModUser is POCO that the repository ex...

Find random point along a line

I'm writing a small program to help split passwords ( see below for explanation) I have code to convert text to a int ( text-ascii binary -> dec int) so in this case the word "test" would = 1952805748 Now the interesting part.(encoding the password) I would then take x1 = 1952805748 and y1 = 0 then i make up a random point where x2 ...