.net

Why HttpContext.Current.Handler is null?

Hi, I'm trying to access a Page within an HttpModule and I think I should do this by calling HttpContext.Current.Handler (This should reference the current page) but I'm getting null all the time. I'm developing using .Net 3.5 framework. I'm checking this on AuthorizeRequest and AuthenticateRequest Thanks. ...

CLR: If a constructor fails will it always throw an exception?

In Delphi, if there was an exception during construction of an object: any allocated memory would be released and an exception would be thrown. For example, the following was guaranteed to either return a valid Camera object, or throw an exception: Camera c = new Camera(); You never had to check the resulting variable for null: Camer...

Siverlight development setup issue

Hello everyone, If I am using Windows Vista x86 Enterprise as development environment, and I have installed VSTS 2008 + SP1, .Net 3.5 and I use C#. Any additional SDK/components from Microsoft do you suggest I to setup which are must required? Too many terms called Siverlight SDK/Plug-in which makes myself headache. Do not know which o...

How to display HTML using .NET in an interactive way.

What I basically want to do is take some HTML and display it in a way that when you mouse over any element, the application can parse the HTML I'm pointing to. I want to do this with C#/.NET Framework. Using IE is fine in my project and I'll want to basically edit the HTML so that when i hover over a table for instance, the table's bor...

The Limitation of Mono Runtime

My question is similar to this one and this one, but there is a slight difference. So that's why I am asking it here. I have a shiny .Net 3.5 Windows Service ( with NHibernate, LINQ, lambda expression) etc, running on Windows. Now I plan to port my app to Linux, so I am thinking about Mono. Can I just compile my .net app in Windows, an...

Why are my application settings not getting persisted?

So I have some settings that are of the user scope. But for some reason, they are not being saved to the .exe.config file. I do the following: Properties.Settings.Default.Email="[email protected]"; Properties.Settings.Default.Save(); Yet I look at the settings file in the debug folder and it is still the default that I set in visu...

Yet Another ugly if statement question in C#

Hi, I have the following ugly if statement that is part of a class that is pulled from an IOC container: protected virtual void ExecuteSourceControlGet(IBuildMetaData buildMetaData, IPackageTree componentTree) { if ((buildMetaData.RepositoryElementList != null) && (buildMetaData.RepositoryElementList.Count > 0)) { compo...

Can I do this in my unit tests?

Hi I am not sure what I should be doing here. Should I be hardcoding all the values in or should I have them in a CONST variables. Everything I seen seems to hard code the values in so I am not sure. Like this is what I was doing now. Say in my controller I had a validation test to check if the user tries to submit a form with a blan...

BindableLinq collection nesting

I'm wondering if there is a way to do this in bindable linq: var LeftItems = AllItems.Where(p => !RightItems.Contains(p))); I have tried liberal use of the AsBindable(), but it doesn't work for me.. var LeftItems = AllItems.AsBindable().Where(p => !RightItems.AsBindable.Contains(p))); If this is not supported in BindableLINQ, is th...

Does anyone know if there a .NET API for Project Natal?

I have just discovered Project Natal from Microsoft, it looks pretty cool and was wondering if there was any starting points for developers to get into it? ...

Parsing and evaluating given conditions

What I'm trying to do this is writing a simple parser for the following case in .NET ( [PART3]function1() AND [PART4]function7() ) OR [PART2]function90() [PART] indicates the evaluation location, (assume that this is huge text file, PART separates text files into large chunks) function() s are my documented function which can be call...

Retaining Base Class Attributes in Dynamic Proxies

I am using Castle DynamicProxy2. Is it possible to tell proxy object to inherit attributes on its Base Class(proxied class) and attributes on Properities of Base class. If not possible in Castle. Any other library for this purpose?? I have posted source of problem here http://stackoverflow.com/questions/1053328/generic-ipropertychanged...

SetupDiGetDeviceInterfaceDetail unexplainable error

Hello again folks This time I have an error which I have been trying again to figure out why it exists. Although the error can be ignored but I'd like to know why it exists in the 1st place. result = SetupDiGetDeviceInterfaceDetail(deviceInfoSet, ref anInterface, IntPtr.Zero, 0, ref buffersize, IntPtr.Zero); if (!result) ...

django-like frameworks?

Hi I've been working with django for some months and find it really helpful, is there alike frameworks for other programming languages such as java or c#? The problem I suffer by using django is finding a server to host the proyect because supporting servers are more expensive and harder to find. From django I find useful: the object-re...

How can I describe a bug as a feature?

I often hear of situations where a bug in a program is passed off as a feature. This seems like a useful skill to have. Please describe a technique for doing this - preferably with specific examples. ...

Need advice for large .net data access layer

Hi all, Starting up a new project it is 100% new development against a very large (300 tables) legacy database. The database does not match up all that well to the business model so my initial thoughts where to use a ORM. I got a proof of concept working with NHibernate pretty well... but got A LOT of management push back on the use ...

Consuming Python COM Server from .NET

Hi all, I wanted to implement python com server using win32com extensions. Then consume the server from within the .NET. I used the following example to implement the com server and it runs without a problem but when I try to consume it using C# I got FileNotFoundException with the following message "Retrieving the COM class factory for...

Shall I deploy app.config with my installer?

As far as I understand all default settings of app.config settings is hard coded in the application and will generated on the fly in the first run. If this is true then there is no good reason to deploy these files with an installer or in a zip package, am I right? Or am I missing something in here. I want to be sure before rolling out...

Does my IBackingStore need to be thread safe ?

The documentation of the enterprise library says : Because of the way the Cache object operates, you are guaranteed that any backing store will be called in a single-threaded manner. This means you do not have to make your implementation thread safe. And concerning the CacheManager : Every method call made through the ...

speech recognition from audio file instead of microphone

Hello, How can I perform speech recognition on speech coming from an audio file (.mp3, wav) instead of the microphone ? I want to be able to do that from C#.NET and Delphi. thanks. ...