.net

Setting a style on Control type not working

I'm writing a very basic WPF dialog and want to apply a simple style to all objects that inherit from the Control class. The code I'm using: <Window.Resources> <Style TargetType="{x:Type Control}"> <Setter Property="Margin" Value="20"/> </Style> </Window.Resources> <StackPanel> <TextBlock Text="some text"/> <Tex...

"Hiding" linq classes inside a namespace?

Hi :) Is there any way to make the generated linq classes stay inside a namespace? The reason being that im working on a big project, and there is alot of tables with different names, and i dont want them to be accessable from anywhere in the project, unless we add the namespace.. I know thats already implemented in the entity framewor...

Getting subject line of e-mail using webDAV and .NET

I need someone more well versed in this area to re-title the question I am trying to learn more about webDAV and .NET. I have written an app that needs to pull all e-mails from an inbox on the server. I need to load these e-mails into an object that has the following properties: - From - To - Subject - Body I found a VERY he...

HTML Diff Component for .NET

Is anyone aware of a good managed code .NET component which can do HTML Diffs? I'd like to compare two HTML files and show the differences. ...

Recommended .NET encryption library

After reading (yet another) post by Jeff more or less concluding that us mortal developers shouldn't be getting too involved with encryption, I'm left wondering what library I should be using. The only two libraries I've found that seem legitimate are entlib's and bouncycastle, but they don't seem much more of an abstraction than the .NE...

How to make sense of WCF traces

I know how to enable WCF tracing and view them in the trace viewer tool, but I don't understand what it all means. is there documentation somewhere that explains what each of those levels means and how to make scene of all the information that is being logged. also what is a good source to learn about a WCF request/response life cycle. ...

Best way to test if a Type is a collection

I have a method that accepts a parameter obj of type System.Object Now I want to check if the actual type of obj is: A collection type (IEnumerable). Anything else. The first way I thought of is: if (obj is IEnumerable) // obj is a collection But System.String implements IEnumerable, and I don't want to treat string as a coll...

Is there an easy way to access Outlook contacts outside of VSTO?

At work we use a couple of custom columns in the Outlook contacts to serve as an "signout board" so we can see when developers are at another site since we're spread out across a couple of locations. The way this is currently implemented is via a custom view of the contacts that is displayed as a spreadsheet that folks can update their s...

linking to google analytics

We want to add google analytics a fairly large .NET web site. The site uses several master pages (4 or 5) and so I was going to just paste the requisite javascript into each master page. <script type="text/javascript">//<![CDATA[ var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www."); ...

C# searching through lists

Hi, In the following code I'm using 3 foreach statements. I'm just looking to populate a list when a list of items matches another but the ones that don't match also have to be added. So I was wondering if there is an easier way to do the following. List<T> ds = new List<T>(); //is populated foreach (var b...

Can't see the designer view in Visual Studio 2008 C# Windows Forms due to weird error.

Hi, when I try to click on the designer tab to get the designer view, I get this error: To prevent possible data loss before loading the designer, the following errors must be resolved: The designer could not be shown for this file because none of the classes within it can be designed. The designer inspected the follo...

How to map foreign key attribute tables to a business entity

I have a table in a database that I'm mapping to a main entity class. The table has some columns that hold foreign key values to other attribute tables. How do I map these to the business classes? Do I create a new class for every attribute table and have the primary class hold these as properties? ...

Web Service Project vs Web Site with .asmx file: differences and worth upgrading?

Consider 2 scenarios where we want to host a .NET web service. Nothing too fancy, simple data types back and forth. They both reference out to an assembly to perform the complex business logic & data access. The project would have a couple .asmx files each with a couple methods apiece. Web Service Project When Visual Studio creates th...

What is the underlying mechanism used to communicate between .Net AppDomains in the same process?

I realize a rational knee-jerk response would be "Remoting you idiot! Read the MSDN docs." Every scrap of info I can find concerning .Net Remoting is in the context of inter-process communication: sockets, shared memory, pipes...the classics when it comes to IPC, but an AppDomain is not really a process. However, AppDomains seem to en...

Inconsistent DataContractAttribute behavior

based on my understanding WCF's data contract model was opt-in vs the old opt-out approach of asmx web-services. you have to explicitly include all the fields and types that you require using DataContractAttribute and DataMemberAttribute. my experience however has been different. take a look at the following examples, ///CASE: 1 ///B...

How to check if webbrowser control is busy/in use?

I am loading a page in a webbrowser control. How can i check when its completely done? i know about DocumentCompleted, but one page may call it 5 or many more times. How do i check when its completely done? ...

How to convert XML file to a Database?

I recently downloaded the SO Data Dump and was wondering how I could convert it from XML to a DB that I could use in my .NET applications. ...

IIS hosting WCF service error

Hello everyone, I am using IIS 7.0 to host a simple WCF service. I write it by using VSTS 2008 + .Net 3.5 + C#. The issue is when I access http://localhost:9999/service.svc (I suppose in web browser we can browse the content of WSDL, and I create a new web site which uses port 9999 and run application pool under administrator account), ...

.NET equvalent of Java's NIO Selector

I know .NET has a good asynchronous model for network I/O, which uses completion port under the hood. But all the callbacks are happening on IO threads from thread pool. Is there any .NET counterparts like Java's selector which deals with multiple streams in a single thread? Or, the thread pool callbacks scale better than this single th...

How to send a WPF window to the back?

In my application I have a window I use for plotting debug data. When it loads, I would like to open it "in the background", behind all other windows. What's the best way to achieve this? ...