.net

Using a SOAP 1.1 web service from .NET 3.5

It appears that .NET 3.5 is enforcing the SOAP 1.2 schema when dealing with web services, even if the service specifies SOAP 1.1 in the schema for the SOAP envelope. Is there a setting to for the service reference to recognize SOAP 1.1? EDIT: The issue is the formatting of SOAP Faults returned from the web service to the .NET 3.5 clien...

How to create a custom control with both an enabled and disabled visual state and a content presenter.

I'm new to making custom WPF controls so I'd really appreciate a little help and some explanation. Here's the situation: I'm trying to make a custom control with the following traits: The control must have a content presenter. The control must have either a disabled/enabled visual state, or be tri-state, (unstarted/inprogress/finished...

InvalidOperationException When XML Serializing Inherited Class

I am having an issue serializing a c# class to an XML file that has a base class... here is a simple example: namespace Domain { [Serializable] public class ClassA { public virtual int MyProperty { get; set; } } } namespace Derived { public class ClassA : Domain.ClassA { public overrid...

DropDownList tooltip in Chrome and Safari

To add a tooltip to my DropDownList items I have DropDownList1.Items[i].Attributes.Add("title", tooltip); Problem is this doesn't work in Chrome and Safari. Any other way to add a tooltip, or any way to fix this in Chrome and Safari? ...

Scope of HttpContext.Current.Items

Are the HttpContext.Current.Items lost when a Server.Transfer(); occurs? If so what is the best way for me to send information to another page without going through the Session? ...

Strange unhandled exception

Hello, I've been developing a windows app in .net C# for GSM Modems and i've come across a strange error: System.ObjectDisposedException was unhandled Message="The secure parameter identifier was closed (pt: O parâmetro identificador seguro foi fechado)" Source="System" ObjectName="" StackTrace: at Microsoft.Win32.Unsafe...

Converting UK times (both BST and GMT) represented as strings to UTC (in C#)

I have to use some dates and times from a legacy database. They are represented as strings. Dates are dd/MM/yy. Times are HH:mm. I'd like to convert these to UTC as soon as I pull them from the database. I'm working on US systems, so need a common time. The problem I'm facing is how to convert them to UTC DateTime values. I can do the ...

WinForms Dynamic Localization

We have CAB (Composite Application Block) based smart client winform application. One of our software requirement is to replacing the text dynamically when the user change the language option provided in our application. We support around 6 languages including east-asian(Chinese/Japanese), European Languages(Russion, spanish, English,...

Strongly-typed views in ASP.NET MVC 2.0 Preview 2 no longer function

I had a functioning ASP.NET MVC 1.0 Project with strongly typed views. They no longer function after upgrading to ASP.NET MVC 2.0 Preview 2. The Model property now is an Object instead of the requested type. I have this: <%@ Language="C#" Inherits="System.Web.Mvc.ViewUserControl<IEnumerable<TechHelp.Core.Models.Ticket>>" %> I g...

What is the FDG for naming boolean properties?

What is the Framework Design Guideline for naming boolean properties? If there isn't one, then what's your recommendation? Let's say I have a User class, and I need a property that specifies if the user is enabled or not. These are the options I can think of: Enable Enabled IsEnabled Disable Disabled IsDisabled Also, if the BL says ...

How to get the body of a predicate?

I Have a quite simple question that I just cant figure out. The method code is simple: protected void Require<TValidator, TParam>(TValidator validator, Expression<Func<TValidator, TParam>> property, Predicate<TParam> predicate) { var propertyValue = property.Compile().Invoke(validator); if(!predicate.Invoke(propertyValue)) ...

Is opening a file stream a costly operation

Is opening a file stream a costly operation I'd like to provide a lazy loading functionality in a class that reads a structured file. Every element of the file has a header and a payload. the idea is to load only the headers from the file and access the payload data only when the relevent field is accessed a prototype of the class wo...

How do I avoid 'call is ambiguous...' errror when writing static and non-static methods in C# ?

I have a number of classes that represents business transaction calls: executing appropriate stored procedures. Now the looks like this: public static class Request { public static void Approve(..) { using(connection) { command.Text = "EXEC [Approve] ,,"] command.ExecuteNonQuery(); } } } ...

LINQ to SQL for Oracle.ODP

Does LINQ to SQL support Oracle.ODP? If not, is a similar offering from Oracle available or in the works? ...

Does Rijndael always throw an exception if the password isn't correct?

I'm using Rijndael to encrypt/decrypt some sensitive images that will be used on some documents. I'm trying to be absolutely sure that the password provided works and that, by some quirk of fate, an incorrect password will result in a corrupted image that ends up on the document. If I don't catch it before this point, lots of documents...

Extending a WCF Service Reference to a WSDL to implement IEnlistmentNotification

I have a WCF Service Reference to a WSDL file for a credit card processing web service (Cybersource). I'd like to somehow extend the generated service reference client to implement IEnlistmentNotification as to support transactional processing. I am familiar with implementing the IEnlistmentNotification interface, but I can't find a go...

How do I share user settings or files using the UserAppDataPath across builds?

Right now when I release a new build of my .NET app, the UserAppDataPath path points to a new folder that includes the build number. Documents and Settings\UserName\Application Data\Company\AssemblyName\1.0.0.0 I use this path as a convenient storage place for extended user UI setting files. Every time I release the user looses...

long/large numbers and modulus in .NET

Hello, I'm currently writing a quick custom encoding method where I take a stamp a key with a number to verify that it is a valid key. Basically I was taking whatever number that comes out of the encoding and multiplying it by a key. I would then multiply those numbers to the deploy to the user/customer who purchases the key. I wanted...

Multipart Downloading in C#?

Please excuse my ignorance on the subject. I would like to write an application in C# that can download files off a server the same way DownThemAll does. DownThemAll seems to open four connections to the HTTP server to download the same file. I was just wondering if there are any existing libraries that might do this. Here is a quote f...

How can I write a Google Wave rich client?

I am not sure my question makes any sense. Google Wave is using HTML 5 and such. But if I have a desktop (say winforms) application, can I leverage google Wave for collaboration/discussion? Does it even make sense? If so, what's the API? ...