.net

Jerky Animations in WPF

I have an animation in WPF that is jerky, my WPF form is layed out as follows: a 1280x800 Window contains a 2400x7** grid, seperated into 3 columns. Column 1 is * width Column 2 is 148 width Column 3 is * width This allows me to, using an animation, chage the grid's margin to ~-1000 on the left side to bring the left column off scr...

Forms Authentication Redirect cause Anchor loss

So here is the problem. I use Anchors as a non-refreshing way to allow bookmarking of currently view objects. http://myserver/showobject.aspx#objectid=10 I use this so when updating the object id it doesn't try to do a refresh on the page. Heres the rub. I am using forms Authentication to handle access to these pages. So When you t...

Please explain this SerializationException to me.

The simple class below inherits from HashSet and thus has to implement the ISerialization members (in a non standard way). I get the following Exception when I try to serialize then deserialize an instance of Group: Test method UtilitiesTests.GroupTest.SerializeTest threw exception: System.Reflection.TargetInvocationException:...

Is there a way to create an ADO.NET connection and ignore the ambient Transaction?

I have a situation where I am running in a WCF service that has TransactionScopeRequired=true, which means there will always be an ambient transaction. However, I need to start a new connection that will be around for the lifetime of the application, which means I can't have it use the abmbient transaction. Any ideas on how to do this?...

Convert a single hex character to its byte value in C#

This will convert 1 hex character to its integer value, but needs to construct a (sub) string. Convert.ToInt32(serializedString.Substring(0,1), 16); Does .NET have a built-in way to convert a single hex character to its byte (or int, doesn't matter) value that doesn't involve creating a new string? ...

HttpContext.Current.User not populated with Windows Authentication enabled

I have an asp.net intranet application using windows authentication. I created the application years ago with VS 2005, and the windows authentication bit was working perfectly. My web.config has the following (inside configuration -> system.web element): <authentication mode="Windows" /> <authorization> <deny users="?"/> ...

Design by Contract: Can you have an Interface with a Protocol?

Hi all, I'm pretty new to the concept of Design by Contract, but so far, I'm loving how easy it makes it to find potential bugs. However, I've been working with the Microsoft.Contracts library (which is pretty great,) and I have run into a road block. Take this simplified example of what I'm trying to do: public enum State { NotReady...

When do LINQ-to-SQL queries execute?

I just want to confirm... LINQ-to-SQL queries never execute (hits the database) until it is enumerated, right? Does anyone know if this is the same for LINQ-to-Entities? Thanks! ...

Who is responsible to set the To header (Ws-Addressing) in an outgoing message ?

I'm creating a transport binding in WCF, and I've seen that outgoing messages of my output channel don't have the To header set (WS-Addressing). I don't really want to add yet another responsability to my transport channel. Do you know a behavior or binding which takes care of that for me ? ...

Watin IENotFoundException

I wrote a short bit of WatiN code (see below). it works great in Dev. Just wonderful. When I deploy it to the production server it opens IE, then fails with an IENotFoundException. .NET 3.5 Server 2008 IE 7.0.6 I'm at the point where I'm getting ready to download the source and debug, but I'm not sure how far I'll get as I have yet ...

Point of Sale Application Architecture

Hi Guys, I have been asked to build a POS Application for a Restaurant. I have experience creating POS application in VB6.0 and have always wanted to create one with UX. I am looking to create one with WPF as front end. I pretty much have the process picture in mind and also screens. Said so much, I am not sure how to Architecture one....

Building .NET 4 projects with Nant

How do I get nant to build projects that target the .NET 4.0 Framework? ...

ObservableCollection FileSystemWatcher ListBox Updating Issue

I have an ObservableCollection that is using a FileSystemWatcher to automatically add other PNG images that have been added to the directories. The ListBox has the ItemsSource databound to the Photos object using the following XAML. <ListBox ItemsSource="{Binding Source={StaticResource Photos}}" IsSynchronizedWithCurrentItem="True"/> ...

Queue operations in a WCF service

I am working on a Windows forms application where I would like to queue operations for a windows service to accomplish in the background. I was reviewing using WCF for this purpose and it seems to fit the bill, although I am unsure how to implement a queue for these sort of operations. What I envision on the client side (the forms appl...

.NET - how to identify machine type (laptop/desktop) and screen type (crt/lcd)

Is there a foolproof way for a .NET app to identify... whether a machine is a laptop or a desktop whether the screen is an LCD or a CRT the size of the screen ...

Database handling from web service - how to improve the performance?

Hi, I created a web service which is called from the client side to store the data into the database. These data are sent every 200 ms from a single user and each time the data are sent the database connection is opened and closed which I believe is not good for performance. The data are stored by calling REST.StoreAcceleration() metho...

can we run javascript in .net window application

hi I am developing a application in which i want to show pop up and loading image . for this i need to use jquery can it possible to run these script in .net window application form as iam not using asp .net . ...

CPU Stuck at 100% on Customer PC, any debugging suggestions?

Hi all. I'm having a dead-end situation with one of the clients using my software. Out of about 40 copies of our product sold (Application programmed in .NET 2.0 using VB.NET 2005), about 2 get non-responsive with 1 core of the dual core CPUs stuck at 100% (program uses 1 core only) The most logical guess is an infinite loop causing th...

issue to get specific XML element value using C#

Hello everyone, Suppose I have the following XML document, how to get the element value for a:name (in my sample, the value is Saturday 100)? My confusion is how to deal with the name space. Thanks. I am using C# and VSTS 2008. <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"&gt; <s:Body> <PollResponse xmlns="http...

Add Two Numbers Without Knowing Their Type in .NET?

How do I add two numbers together when I don't know their type in .NET? For example, how would you implement the following function? public object AddTwoNumbers(object left, object right) { /* What goes here? */ } Assume that the 'left' and 'right' parameters are (boxed) value type such as Int32, double, Decimal, etc. You don't kn...