.net

Custom resource provider - how to customize expressions for my need?

I have a custom IResourceProvider implemented for SQL. I store localized strings like this: LANGUAGE_LABEL (id, url, type, name, culture_code, value) I've created a helper which so I can go like: Html.Resource("Common, Hi") //Global resources ('Common' stored in `type`) Html.Resource("Hi") //Local resources ('path_of_v...

Best open source project hosting site for .NET projects

I found a couple questions similar to this, but not specifically for .NET projects, and also both questions I found were pretty old and the answers/votes seemed very out of date since a lot has changed about the sites since the answers were written. So my question is, what is currently the best hosting site for open source projects usin...

.NET: Will tracelistener run on a seperate low priority thread?

I was provided by an tracing API which was developed in house which directly writes to database on the same thread of the caller. I didnt like the approach. I thought an implementing custom database tracelistner but wondering if it will run on a seperate low priority thread or do I have manage threading myself. ...

Why combobox refresh doesn't work?

Hello, I have a complex problem, could you please help me. The problem: I have a form with a TabControl. There are two TabPages in the first is a dataGridView and in the second are multiple comboboxes. DataGridView is filled with data from Table1, on the other tab the first combobox datasource is set to TableCB1, the second combo...

How to create a method which accepts a lambda expression as an argument?

I am using the following code to pass a property to a lambda expression. namespace FuncTest { class Test { public string Name { get; set; } } class Program { static void Main(string[] args) { Test t = new Test(); t.Name = "My Test"; PrintPropValue(t => t.Na...

Create custom expression for localized business content?

In short: I have an SQL implementation of the IResourceProvider. So: <asp:Literal id="id" text="<% $ Resources : Common, SomeResource %>" runat="server" /> works and I've created a helper so I can pass a string expression and get the same result: <%=Html.Resource("Common, SomeResource") %> I want to localize business content. Whic...

My VSTS 2008 has no Analyze menu. Where did it go?

I have VSTS 2008 but no Analyze menu. Why did it happen in first place? And how can I get it? ...

How to Use Scintilla .NET in C# Project?

I am attempting to use Scintilla .NET in a project (I want a good editor + syntax highlighting, etc). Unfortunately, when I reference the binaries in my project, I can't seem to actually use the Scintilla controls. I get two different errors. The first happens when adding SciLexer.dll as a reference to my project. I get a message th...

accessing image control from codebehind

Compiler Error Message: CS0030: Cannot convert type 'System.Web.UI.Control' to 'System.Web.UI.WebControls.ImageField' Line 107: protected void BookListView_DataBinding(object sender, EventArgs e) Line 108: { Line 109: ImageField img = (ImageField)BookListView.FindControlR("Image1"); Line 110: if (img.ImageUrl == "") ...

A practical replacement for ICloneable

The "question" here is a general discussion topic. It's pretty well known that ICloneable has serious problems. Purely immutable objects are trivially cloneable (by reference), so it's safe to assume that the interface for cloning an object deals with mutable objects. One place where I've seen the concept of a cloneable object be extrem...

Any compelling reason to stay on WCF?

I've been trying to create a stable web service application for the last 2-3 months. about 2 months ago I made the choice to move over to WCF to take advantage of the single instanced web services. Since making that move I've had some real headaches deploying to IIS 6 scenarios. Unfortunately because most real clients still use Windows...

.NET / WPF Alternative

I know the .NET framework and WPF pretty well, but I think the whole thing has gotten too blown up, especially for small apps as the whole .NET framework 3.5 weighs 197 MB by now. I am looking for a language/framework/library that provides functionality similar to that of WPF (animations, gradients, a.s.o.) and the .NET framework (of c...

Is it possible to build Windows Mobile emulation into an application?

I'm building an application that's a host of various other applications (of sorts). One of the features I wanted to try and achieve was the possibility of running Windows Mobile applications. I know an emulator can be downloaded from MSDN but everything suggests it is only really for testing Mobile apps. Would it be a possibility to s...

ASP.NET fails to correctly handle comma delimited cookies

According to the RFC, individual cookies in the "Cookie" HTTP header may be separated by commas as well as by semicolons. However, ASP.NET does not parse the commas case correctly - it does not count comma as a separator, but considers it just part of the value. For example If a client sends header Cookie: a=b, c=d, then the ASP.NET app...

.net dynamic assemblies

I was recently asked if I knew anything about Dynamic Assemblies in .Net. The short answer was - I don't. I have found plenty of articles that describe how to create a dynamic assembly but none that truely explain the following: What they are (other than they are run directly from memory) What advantages they provide over static assem...

Return the uniqueidentifier with entity framework

I am using Entity Framework 3.5, while inserting a record i want to return the unique identifier with entity framework. How to do that? ...

Explain introductory timing of Action<T> versus Func<T,TResult> Delegates

Why was Func<T, TResult>(..) introduced with .NET 3.0 whereas Action<T>(..) with .NET 2.0? Edit: I'm coding a project in .NET 2.0 right now and am missing Func. Although it's easy to roll your own as mentioned in the comments and answers i.e. simple delegate TResult Func<T,TResult>(T); I am curious why the timing would be different with...

HTTP Headers for Unknown Content-Length

I am currently trying to stream content out to the web after a trans-coding process. This usually works fine by writing binary out to my web stream, but some browsers (specifically IE7, IE8) do not like not having the Content-Length defined in the HTTP header. I believe that "valid" headers are supposed to have this set. What is the pro...

ASP.NET/SharePoint master page issue

Hello everyone, I am using SharePoint Server 2007 + C# + .Net 3.5 + VSTS 2008 + ASP.Net. And I am using collaboration portal template. I am developing a custom aspx page and put it in _layout folder of a site and I want to apply default.master of the SharePoint site to this aspx page. Any samples about how to achieve this goal? thanks...

how do I get the class/property/etc associated with a .NET attribute?

If I apply a custom attribute to a class, for example: [Foo] class Bar {} It's clear that when I retrieve my Foo attribute instance, that it's associated with a Bar. Inside the Foo implementation, say in the ctor, how do I get the class associated with the instance of the attribute? So far, all I've been able to come up with is puttin...