.net

silverlight popup control issue

Hello everyone, I am using VSTS 2008 + Silverlight 3 with Silverlight Popup control. I am confused about the VerticalOffset property. From MSDN, it is mentioned, "Gets or sets the vertical distance between the target origin and the popup alignment point. This is a dependency property." http://msdn.microsoft.com/en-us/library/system.w...

Disable "Save Target As" option in the right click menu

How do I disable the "Save Target As" item in right click menu in Internet Explorer and Firefox browsers? ...

How to modify RegularExpression to Parse vCard/vCalendar to allow a particular field type?

I have an vCard application that needs to read vCard Data, and have found a RegularExpression which gets the FieldName, Encoding and FieldValue from the file, here it is below: ^(?<FIELDNAME>[\w-]{1,})(?:(?:;?)(?:ENCODING=(?<ENC>[^:;]*)|CHARSET=(?<CHARSET>[^:;]*))){0,2}:(?:(?<CONTENT>(?:[^\r\n]*=\r\n){1,}[^\r\n]*)|(?<CONTENT>[^\r\n]*)) ...

C# - How does CLR organize memory/reference during the inheritance ?

Suppose i have the code snippet as follows : ( clarification purpose/not well formed) class Employee { #region fields protected string _empID; protected string _empName; protected readonly string _ssn; #endregion public Employee(){} public Employee(string _empID,string _empName,string _ssn) { ...

Why won't this load storyboard event in WPF not fire?

Ok for some reason I've set up an event trigger for window.loaded in WPF to fire the AnimationBoard storyboard but for some reason it doesn't want to load. Any ideas out there? Thanks! Below is the code: <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" ...

How to mockup Elmah?

Hi I seen this post but I am sort of confused by it. http://stackoverflow.com/questions/1019833/how-can-i-mock-elmahs-errorsignal-routine I am looking at option 2 Create a wrapper class around the call to Raise and just mock out the wrapper class. public class ErrorSignaler { public virtual void SignalFromCurrentContext(Exception e...

Odd resizing of controls VB .net

I have a listbox and a panel. In my forms resize event, my listbox is always form1.width * 0.5 and then the panel is also, but it doesnt work very well. I They overlap at a certain point but in theory, they never should. Is there something wrong with my logic? Thanks ...

WebRequest.GetResponse locks up?

When writing the below my code locks up on GetResponse. Why? try { WebRequest myWebRequest = WebRequest.Create(strURL); WebResponse myWebResponse = myWebRequest.GetResponse(); //more code here ...

Get variable (not hard-coded) name?

I am looking for a way to retrieve the variable name, so I don't have to use hard-coded declarations when needed (for property names etc.): I hardly believe it's possible; maybe someone has a solution. Note: even not variables, properties would also be a move. 'Pseudo: Module Module1 Sub Main() Dim variable = "asdf" ...

How can I create an ItemsControl that renders each "item" as a point on a PolyLine?

I'm very confused by the MSDN samples. And all the samples I find generally revolve around text items in a StackPanel or something similarly simple. Given an array of numbers as the ItemsSource - ItemsSource = { 25 , 50 , 75 } the ItemsControl should procuce only this: <PolyLine Points="0,25 1,50 2,75" /> As shown, each item...

What are the internal limits to WCF

WCF has lots of limits imposed on it to protect against DoS attacks and other developer brainlessness. What are these limits? And how can they be overriden? Specifically, if I was to try to send a large number of messages in a short period of time to a variety of different clients, what are the internal WCF limits they may cause message...

Operation can only be performed on cells that belong to a DataGridView control

The following code throws an InvalidOperationException with the above message and I don't understand why. My code calls the following method when the user may have made changes to the datagridview's underlying data source. The goal is to update the display with any changed data, and preserve the sort column and order. private void Rel...

How to throw a SqlException(need for mocking)

Hi I am trying to test some exceptions in my project and one of the Exceptions I catch is SQlException. Now It seems that you can't go new SqlException() so I am not sure how I can throw a exception especially without somehow calling the database(and since it is unit tests it is usually advised not to call the database since it is slow...

Is it possible to create your own widgets in XAML?

Is it possible to create your own widgets in XAML? ...

How to load images defined in css file in .net mvc application deployed to a virtual server

In my View, I have included the css : <link rel="stylesheet" type="text/css" href='<%=Url.Content("~/Content/login.css")%>'/> in login.css, I have #center_left { width:691px; height:190px; background:url(../../images/login_g09.gif); float:left; } This works fine when I use VS 2008 to run the application. Howev...

Recommended math library for C#/.NET?

Hi, I'm currently evaluating different math libraries for my next .NET project, the decent one I found is Math.NET, which is free and open-source. Do you have any recommendation for good math libraries?, free ones are preferable of course, but that isn't a prerequisite. EDIT: To make the question a bit more clear, I need a math to do ...

Retrieve OpenId User Information (Claims) across providers

I'm using DotNetOpenAuth to log in as part of my login process. It works great for handling authentication but the process of retrieving user information from various openId providers is not working very well. Using MyOpenId I do get full information that I request using a ClaimsRequest with DotNetOpenAuth. It apparently uses the SREG p...

Boxing / Unboxing Nullable Types - Why this implementation ?

Extract from CLR via C# on Boxing / Unboxing value types ... On Boxing: If the nullable instance is not null, the CLR takes the value out of the nullable instance and boxes it. In other words a Nullable < Int32 > with a value of 5 is boxed into a boxed-Int32 with a value of 5. On Unboxing: Unboxing is simply the act of obtaining a refe...

Using a Stored Procedure

Hello guys, I want use a stored procedure in my project but I have no idea about it. Please could you tell me a little bit about how to use I can use one in my vb.net application ? ...

How to handle new versions of a .NET application in Subversion?

I'm new to source control in general and am wondering how to handle the following scenario: Say I have an application written for one platform, say Windows Forms in .NET and I've developed it using Subversion (or any SCM software I suppose). Now I'd like to update the application to use WPF and maybe add a few other enhancements. Would...