.net

Catching a Contained Control's Mouse Events in a UserControl

I have a UserControl that contains another UserControl. I'd like the containing control to be able to handle any mouse events that happen over the contained control's area. What's the easiest way to do this? Changing code for the contained control is possible, but only as a last resort. The contained control has a window that is contr...

regex to split line (csv file)

I am not good in regex. Can some one help me out to write regex for me? I may have values like this while reading csv file. "Artist,Name",Album,12-SCS "val""u,e1",value2,value3 Output: Artist,Name Album 12-SCS Val"u,e1 Value2 Value3 Update: I like idea using Oledb provider. We do have file upload control on the web page, th...

Does return inside a lock makes any difference ?

Sample One Public _objLock As Object = New Object Public ReadOnly Property MyObjects() As IEnumerable(Of Object) Get SyncLock _objLock If _myObjects Is Nothing Then _myObject = LoadMyObjects() End If Return _myObjects End SyncLock End Get End Property Sample T...

Regular expression only returning one match

This regular expression is only returning one match. (I'm looking to retrieve all image sources/locations (such as 'folder/image.png' contained in the src attribute in the img html tag). Sample input string: input = @"<p>here is an image</p><img attr=""ahwer"" src=""~/Images/logo.png"" st=""abc""/><p>some more text here</p>"; ...

HEAD with WebClient?

I am going to assume the answer is no but.... Is there a way to use WebClient to send the HEAD method and return the headers as a string or something similar? ...

Is this a correct use of DateTime? Will it work for all timezones?

So, I'm storing a DateTime object as a private member on an object. This private member is set on object creation like so: this.mCreateDate = DateTime.UtcNow.ToUniversalTime(); Now, later on in the application, I want to see how long the object has been alive for. This could be many weeks (this is a long running web app). I'm get...

Haskell for the .net platform?

I'm a .NET developer by day, but have been playing with Haskell in my spare time for awhile now. I'm curious: any Haskell .net implemenations in the same vein as IronPython? ...

Html Encode when data is inputed? Or Outputed or both?

Hi Just wondering should I encode all the data before I put in to the database or when I display it to the user? Or Both. Right now I do it when I display to the user. I am using asp.net mvc 2.0 so I usually just make everything <%: %> what does encoding for me. I am not sure with both though it might be a little extreme to do it to t...

Nusoap not throwing exception when my Webservice is down!

I have a Php application running on my "Server A" that consumes a .NET Web Service hosted on my "Server B". For some reason sometimes the IIS on my "B Server" fails to response and on my Php web application takes exactly 60 seconds to load the page where the webservice call is. I want to be able to change those 60 seconds because is too ...

Convert items in List<> to a concatenated and formatted string?

Given: protected class Marker { public string Name { get; set; } public string Lat { get; set; } public string Long { get; set; } }; List<Marker> allMarkers = new List<Marker>(); allMarkers.Add(new Marker{Name="Bondi Beach", Lat = "-33.890542", Long = "151.274856"}); allMarkers.Add(new Marker{Name="C...

Which Session Method to use when removing?

Hi I been using Session.clear() and I noticed in firecookie that the session still exists. So I started to google around and found there are 4 ways to remove a session Session.Remove(strSessionName); Remove an Item from Session State Collection Session.RemoveAll() Remove all items from session collection Session.Clear() R...

How to use Unity in order to implement a simple component publishing engine.

Dear ladies and sirs. In our project we have implemented a simple facility to let one party publish dynamic components and yet others - to consume them. I would like to phase out our in-house implementation and take something ready off the shelf. Since our UI guys already use Caliburn+Prism+Unity, I decided to go with Unity (having two ...

Is there any Iron Python plug-in for Monodevelop?

I have installed Iron Python on my Ubuntu 10.4 and Mono Develop, but there is no interaction between them. Is there any Iron Python plug-in for Monodevelop as in VS? If not, wich is the best Iron-Python IDE for Ubuntu or Debian? ...

Get the property name used in a Lambda Expression in .NET 3.5

Hello, I have a problem that has been nagging me for some time now and I can't find the answer. I need to obtain the name of the property that is being referenced in a Lambda Expression. I would provide the lambda expression to a method that would return a string. For example if I have: x => x.WeirdPropertyName then the method would...

.NET Mocking framework for medical devices

Does anyone have experience in using a .NET mocking framework for medical device software? I'm currently considering both Moq and Rhino Mocks and was hoping for some insight on their usage under FDA and EU requirements and possibly some resources on validation performed for either of them. Thanks! ...

Is it possible to restrict/require certain capabilities in a Stream parameter?

I'm writing an application that creates catalogs of files. Currently the catalog information is stored in an XML file, but I'm trying to abstract the interface to a catalog to allow for other future storage mechanisms such as a single ZIP file, SQL server, or HTTP server. So rather than returning a file path the abstract Catalog class re...

Interlocked.Increment of Reflected Value Type

I want to increment integer members of an object using Interlocked.Increment, but I want to reference those integers via reflection. Example code I have, which is not working, is below. public class StatBoard { #region States (count of) public int Active; public int Contacting; public int Polling; public int Conn...

.Net: Static classes and multithreading?

hi I was told that in multithread programs, we would have some troubles by static classes. Could you please explain it more ? ...

how to call a windows form's function from another windows form's event ?

I am developing a windows based application in .net. I have two forms. Form2 is instantiated and displayed when an event occurs in form1. public partial class Form1 : Form { ... private void button1_Click(object sender, EventArgs e) { .... } public void button2_Click(object sender, EventArgs e) { ...

xslt replace function

Hi , I am using fn:replace(string,pattern,replace) function to replace ',' to '.'. URI i used for the function is http://www.w3.org/2005/xpath-functions. But i m getting an exception saying System.Xml.Xsl.XsltException: Cannot find the script or external object that implements prefix 'fn' Can anybody tell me what is the issue. T...