.net

Does the .NET Streams save memory?

Example: If I read a file and copy it to another file through .NET Streams will the total size of the file occupy the memory at any moment? Or will the bytes be discarded as soon as they are used? If the naive approach doesn't saves memory would buffered Streams do it? ...

DSLs and Form Creation

I'm currently working on the requirements/scoping of a project now that could involve: 1) 5 to 6 forms 2) with 250 to 300 questions/fields accross the forms 3) 2 to 3 workflows Are there any .NET or cross-platform tools that will allow me to put the responsibility of developing the forms back onto a non-technical Business Analyst? Are...

My images are blurry! Why isn't WPF's SnapsToDevicePixels working?

I'm using some Images in my WPF applcation. XAML: <Image Name="ImageOrderedList" Source="images/OrderedList.png" ToolTip="Ordered List" Margin="0,0,5,5" Width="20" Height="20" SnapsToDevicePixels="True" MouseUp="Image_MouseUp" MouseEnter="Image_MouseEnter" MouseLeave="Image...

Huge main.cs file

Hello, I am new to C# (coming from Delphi) and find my main.cs file becoming quite large. In Delphi I can create classes in a .pas file and use it from my main application file. I simply add the uses (filename) keyword. My question is how do I do something similar in C#? Example: Delphi: Button1.Visible = False; I can refer to the b...

How to write a .NET Stream to two other Streams simultaneously without buffers?

In my previous question, someone has commented that write a .NET Stream to two another Streams simultaneously is possible. I only could find one way but using a temporary variable (buffer) that would store the contents (fully or partialy at once) of the input Stream. There is any way to do that without using buffers? There is any way t...

Strange TimeoutException in WCF

I have a web application that is talking to a WCF service hosted within a Windows Service. Every once in a while I will start seeing EventLog errors that stating that the request to the WCF service timed out after 1 minute. I understand that error (although why it would take that long to respond is a mystery). The error that really co...

C# Socket Server Send Question

I have a .net 2.0 application that uses the System.Net.Sockets Send() method to send data at regular intervals e.g. every minute. Essentially it is a socket server. Most of the time there will be no clients connected to receive this data but occasionally a user will run an app which will connect to monitor the data that is being sent at ...

How can I see the Entity Framework's pending changes?

I'm creating an application with the ADO.NET Entity Framework. I can step through my code line-by-line while debugging and watch SQL Server Profiler for every query executed, but I can't figure out where all those SQL commands are coming from! Sometimes when I execute SaveChanges(), the Entity Framework performs unexpected, weird INSER...

Asp.NET MVC Model Binding - Using Bind Parameter Attribute to assign a prefix for a simple type

I have a .net mvc app with an controller action which accepts user registration posts. I have the following UI fields: emailaddress, firstname, lastname, password, and confirmpassword. Some of these fields do not belong to a model object (i.e. confirm password does not belong to the user model, only password). My registration form resi...

Obout Grid filtering a column with text populated by a template

I am attempting to filter a column in an Obout Grid that has been bound to a template. Background The DataField of the column is simply a foreign key ID to a History table that contains what are essentially states of a certain object (such as Name, Asset Tag, Serial Number, Additional Info., etc.) If a user were to change a certain st...

Overriding a property with an attribute

I'm trying to find a way to change the serialization behavior of a property. Lets say I have a situation like this: [Serializable] public class Record { public DateTime LastUpdated {get; set; } // other useful properties ... } public class EmployeeRecord : Record { public string EmployeeName {get; set; } // other useful ...

Problems loading assembly dependencies dynamically at run-time

Hi, let me try to explain my problem. I'm currently trying to develop a small "plugin-framework" written in .Net (mainly for experimenting a bit). So the idea is to have a main application to which "plugins" can be added by deploying dlls in a specific folder "plugins" of the main application. Everything works fine, the plugins are inst...

Overriding int on a bit enum

I saw some .NET 2.0 code which looked like this: public enum abc : int { value1 = 1, value2 = 2, value3 = 4 } etc... Now I know the flags enum can be used for bit values (like above, right?) so you can do | "or" &, etc, but what is the reason for not using that? What is the point in overriding int? If I design an enum for c...

how to work with multiple coincident panel controls in VS 2008 windows forms

in VS 2008, I am attempting to design a windows form that is similar to a set of property pages but uses a TreeView to select the page rather than a TabControl. An example of this design is the Options dialog in VS 2008 itself. There are two reasons I want to do this: 1. I prefer the look and feel; 2. I want to give users the ability...

Method Overloading Cost In .Net

Is there a cost associated with overloading methods in .Net? So if I have 3 methods like: Calculate (int) Calculate (float) Calculate (double) and these methods are called at runtime "dynamically" based on what's passed to the Calculate method, what would be the cost of this overload resolution? Alternatively I could have a single C...

Can any one recommend a vector graphics engine for reporting purposes?

Need to develop a .NET solution to graphically represent seats in sections, plotted in a stadium layout view, and output as a report... the seats would have different colours displaying sales status... ...

How to integrate my Web Application with Skype, Gtalk of another IM system?

I want to be able to send reminders to my users, using their IM system of choice, very much like Remember The Milk does when it sends notifications. How can I do that? Additional INFO: I develop in ASP.Net, SQL Server 2008 and Windows 2008 ...

Is F# better than C# in scenarios where you need complete parallelism in parts of an application?

Is F# better than C# in scenarios where you need complete parallelism in parts of an application? My main language is C# and I am writing an app where the core functionality built on top of the app (C#) has to be and planned to be very parallel. Am I better of implementing these classes in F#? ...

How to copy between generic declared types with value type constraints

I have a generic method that copies values between value types. The following approaches give a design time error, even with the struct constraint. Any idea how I can copy or cast between the values? private Ttgt MyMethod<Tsrc,Ttgt>(Tsrc SourceObject) where Tsrc:struct where Ttgt:struct { //Error:cannot ...

Pure functions in C#

I know C# is getting a lot of parallel programming support, but AFAIK there is still no constructs for side-effects verification, right? I assume it's more tricky now that C# is already laid out. But are there plans to get this in? Or is F# the only .NET language that has constructs for side-effects verification? ...