.net

AjaxControlToolkit DateTime FormatException

I can't seem to find anything about this error on the Internet. I've checked the AJAX source code and just can't seem to find any hint as to what is causing this to happen. If I clean the browsing cache, restart the server, the first thing I get is this error, when I refresh, the error goes away and the AJAX controls cease to work. If ...

ComponentModel.LicenseException on Windows 7 for licensed control

I have a project that works fine under Visual Studio 2008 on Windows XP. I'm setting up a Windows 7 64-bit system with Visual Studio 2008 and I have found that one of my licensed controls fails its license check. On compiles I get this error: Exception occurred creating type 'Sax.Barcodes.Barcode, Sax.Barcodes, Version=1.2.0.0, Cul...

Website security - help me suck less

I'm a bit behind the times when it comes to website security. I know the basics - validate all incoming data, escape data being saved to the db, use a salt for passwords, etc. But I feel like there's a lot I'm missing that can bite me in the butt. This is especially true with my slow migration to .NET. I'm just not sure how to replic...

how would I access this WPF XAML resource programmatically?

how would I access this WPF XAML resource programmatically? <Grid.Resources> <Style x:Key="lineDataPointStyle" TargetType="chartingToolkit:LineDataPoint"> <Setter Property="Background" Value="DarkGreen"/> <Setter Property="IsTabStop" Value="False"/> <Setter Property...

Drawing, and Appending to a Double-Horizontal Line

Hello, I know how to draw straight lines in C#, but I would like to draw a horizontal line, with two colors. Light blue on the top, and dark blue on the bottom. Also, how would I sort of... Append to that line? For example, every few seconds, that line will become bigger... like a ProgressBar. (btw, I'm not creating a ProgressBar, just ...

XAML: Rounded corners for all Images inside a FlowDocument!

I want to give all images inside a FlowDocument rounded corners. Whats the easiest way to achieve this? ...

Generic KeyValuePair and Type Inference

Possible Duplicate: Why can't the C# constructor infer type? Why is the following true: var foo = new KeyValuePair(3,4); //doesn't compile! var boo = new KeyValuePair<int,int>(3,4); //works fine! I would think both lines would be legal, since the type can be (should be) inferred from the parameters. Explanation? ...

get values from nested Dictionary using LINQ. Values of Dictionary are list of lists.

How to get values from nested Dictionary using LINQ. Keys in the Dictionary are integer. Values of Dictionary are list of lists. Seconday level list is a list of array holding integer value. Thanks in advance. ...

Changing the right-click menu in Webkit.NET

I'm using Webkit.NET to render a UI for my application, and I want to change the right-click context menu so it only does copying & selecting text, disabling the options to "Search with Google" and "Reload." I couldn't find any examples on the internet on doing this. How would I go about editing the context menu? ...

Getting unique items from a list of strings

I have a very simple text file parsing app which searches for an email address and if found adds to a list. Currently there are duplicate email addresses in the list and I'm looking for a quick way of trimming the list down to only contain distinct values - without iterating over them one by one :) Here's code - var emailLines = new ...

When to use so many kinds of method to create an instance of a type?

I know these methods to create an instance: Activator.CreateInstance() AppDomain.CreateInstance() AppDomain.CreateInstanceAndUnwrap() When to use them? What are their differences? What does the Unwrap mean? Unwrap what? Why don't the other two methods also unwrap? Update Currently, I have the following medical analogy: Activator....

Binding DropdownList in Domain Driven Design

I have created domain model and define entities, value objects, Services and so on. Now, my query is that i have an entity called "Company" which has around 20+ attributes and i want to bind a dropdownlist control in one of my page that require only two attributes i.e. company.Name, company.Id. Why should i use such a heavy entity having...

How to download only the headers with WebRequest

I’m writing some scripts to look for vulnerabilities to the padding oracle exploit in ASP.NET for which I need to look at the HttpStatusCode in the response. I’m doing this across a large number of my sites with different scenarios and performance is important. I can do this just fine with the following code: var req = (HttpWebRequest)W...

c# - approach for saving user settings in a WPF application?

What approach do you recommend for persisting user settings in a WPF windows (desktop) application? Note that the idea is that the user can change their settings at run time, and then can close down the application, then when starting up the application later the application will use the current settings. Effectively then it will appe...

KnownType Serialization Issue

Having read the documentation and many many articles I believe the following should work but it doesn't. This is how my datacontracts are structured. [DataContract] [KnownType(typeof(Friend))] public class Person { private string name; [DataMember] public string Name { get { return name; } set { name = value; }} private P...

Is it mandatory of using 3 tier archeticture while using Entity FrameWork?

Hi everyone!I have a web application where i need to use entity frame work.Actually i came to know that Entity follows 3 layered model.So is it mandatory to use again 3 layered model while using entity?Can any give your valuable idea's and link's regarding this. ...

How to use .net reomting object in ironpython?

IUgRemoting.dll namespace test { public interface IUgRemoting { Session GetSession(); UFSession GetUFSession(); UI GetUI(); } } I test in C# var loader = (IUgRemoting)Activator.GetObject(typeof(IUgRemoting), "ipc://test/test.ShareClass"); var theSession = loader.GetSession(); ...

why is the access modifier of an event is protected by default?

protected void ButtonSheel_Click(object sender, EventArgs e) ...

When does GC run?

When does GC actally run? Is it like it runs in a certain interval or when the application demand memory or what? ...

Getting the frame duration of an animated GIF?

In C#, I can get the individual frames from a gif and show the animation easily enough, but how do you go about getting the timing information for each frame? ...