.net

How can i reference an embedded data file for data-driven unit tests?

This is my scenario, I want to make a Data-Driven unit test, and for being environment-independent i want to embed the data file in my assembly. How can i reference then in the DataSourceAttribute of the Unit Test?. I'm trying to access an Excel 2003 file using the Microsoft Jet OleDB Provider. The unit test works fine when the file is ...

DependencyProperty problem with Double and Single

Silverligh 4, VS 2010. Making a Custom Control. (Non just UserControl, but public class HandPart : Control, and a template in \themes) Then I creating a new DependencyProperty with a helper snippet: #region SomeDouble (DependencyProperty) /// <summary> /// A description of the property. /// </summary> public Double SomeDouble { ...

include assemblies via code? C#

In msvc i can write #pragma comment(lib, "my.lib"); which includes my.lib in the linking stage. In my solution i have 2 projects. One is a class project the other is my main. How do i include the reference dll in code instead of adding the reference in the project? ...

Are there Func objects with more than 4 parameters?

I saw here that Func<(Of <(T1, T2, T3, T4, TResult>)>) Delegate was the last Func in the namespace. What do you do if you need more than 4 parameters? ...

Is it possible to change a textbox's text which is in english to tamil in C#

Question How do I translate text a user types from English to another language? What APIs exist for this? Background When a user types in text into a TextBox on my ASP.NET page, I want it to be automatically translated into Tamil. ...

How to change the background color of a rich text box when it is disabled?

Whenever I set the RichTextBox.Enabled property to false, its background color is automatically set to gray as it is set to the color in system color which is set in the control panel. How can I change its color to black even if I set it to disabled? ...

Get list item value from DragEventArgs

I'm trying to drag a listitem from a listbox onto a picture box. The list item is a persons name. The value member of the list item is the ID of the people listed. When I drop the list item onto the picture box I want to use the persons ID to query a photo and load that photo. I can't seem to access the value though, only the name te...

improve performance in ajax request

hello all i´m doing an ajax request using jQuery and asp.net on this way: $.ajaxSetup({ type: "POST", contentType: "application/json; charset=utf-8", dataType: "json" }); $.ajax({ url: "/WebServices/CompareDates", data: "{allClients: '" + allClients + "'}", success: function(msg) { ...

How to get all instances of a generic class with structure map

In Structure map I have the following line working with domain events: public void Dispatch<TEvent>(TEvent eventToDispatch) where TEvent : IDomainEvent { foreach (var handler in ObjectFactory.GetAllInstances<IDomainEventHandler<TEvent>>()) { if (handler.IsActive) handle...

How do I find out if a .NET assembly contains unmanaged code?

.NET assemblies that contain a mixture of managed and unmanaged code cannot be ILMerged with other assemblies. How can I verify if a given .NET assembly contains purely managed code, or a mix of managed and unmanaged code? ...

Encoding non UTF-8 text in Parameters in ASP.NET MVC

Background I have a web application that uses ISO-8859-1 encoding. When I pass parameters using Html.ActionLink(), the value is decoded to UTF-8: Web.config: <globalization requestEncoding="iso-8859-1" responseEncoding="iso-8859-1" fileEncoding="iso-8859-1" /> Index.aspx This is a <%= Html.ActionLink("test", "Read", ...

Rhino Security implementation for use case "user can only see entities for customers assigned to him"

We're building/designing next generation of our sales/ordering/CRM system which comprises of entities like customer (customer hierarchy in particular), order, promotion action, ... Each user of the system should have assigned one or more customers. Users should be organized in a form of organizational hierarchy. The system should con...

c# Encoding conversion?

Hi, I have a string which looks like: &#xC0; l&#x27;int&#xE9;rieur But it needs to be: À l'intérieur I tried changing the conversion. I know it's read as ASCII encoding. So I tried using the code: ASCIIEncoding ASCII = new System.Text.ASCIIEncoding(); Byte[] BytesMessage = ASCII.GetBytes(Title); Title = Encodi...

How to extract a particular value from an INI File using a Regular Expression?

I am a bit confused how to best use a Regular Expression and hope I can get some help I want to extract a URL value from an INI File as such: [DEFAULT] BASEURL=http://www.stackoverflow.com/ [InternetShortcut] URL=http://www.stackoverflow.com/ So I can get the URL value as the only Match from the Regular expression - but I don't unders...

Is WSA compiler in BOO safe to use?

In our program we use boo as macro system about 2 years. All works like a charm, but python syntax is weird for newcomers. As I know boo has white space agnostic (WSA) compiler with ruby like syntax: instead of def Hello(): print 'Hello' you can write: def Hello(): #notice colon!!! print 'Hello' end here is ideal :) def Hello() ...

What is the vb.net equivalent of the C# “var” keyword

E.g. how do I get VB.Net to statically type a local variable to be the static type of the expression on the right had side of the assignment? ...

Is there any good free Gantt Chart controls for .net winforms?

The question is in the title. I'm looking for a free gantt chart control to use in a .net application. ...

Create a File in a Biztalk message inside a orchestration

Hi! I'm having some trouble sending a file by ftp from my BizTalk 2006RC. The part the i struggle is to create a real file named "OPA0037" with only one line "OPA0037;TEST;;;" that it after the ftp part isn't a problem i juste don't see how to create a file from a message... It can only be in the orchestration. any help any idea is...

Get empty slot with lowest index from an array

Hi, I am using .NET 3.5. What method of the Array class is best for returning a empty index in an array (which can then be used for populating). The Single/SingleOrDefault() methods look good, but if there is more than one empty slot, I want the first with the lowest index. EDIT: This is pretty easy with a loop, but I am looking at way...

Regex Replace - Multiple Characters

I have 20 or so characters that I need to replace with various other characters in a block of text. Is there a way to do this in a single regex, and what would this regex be? Or is there an easier way to do this in .NET? For example, an excerpt from my mapping table is œ => oe ž => z Ÿ => Y À => A Á => A  => A à => A Ä => AE ...