.net

c# lamba expression - add delegate results to generic list

Question: I have just wrote my first code using c# lamba expressions. It works, but I am not sure if this is the best way to do it. Any recommendations on a better way to do the lambda expression? It seems odd to have numerous lines of code in the expression like I do below. Background: I have a generic list of delegates. Each delega...

How do I filter a BindingSource with a LINQ query as the DataSource

I'm having trouble getting a filter to work on a BindingSource that is the DataSource for a DataGridView control. Basically, I have LINQ query that is the DataSource for the BindingSource and I would like to filter down the results. Below is an example of what I'm trying to accomplish. Dim query = From row In dataTable _ S...

Is it possible to copy code from Visual Studio and paste formatted code to OneNote?

Is there a way to copy code from visual studio (C#) and paste it into OneNote, without losing the formatting? I was able to do this, but only if I copy from VS, paste to Word, copy from Word, and then paste to OneNote. ...

Why Windows 7 isn't written in C#?

I saw a similar question about the reason Google Chrome wasn't written in C#. But with the upcoming version of Windows and Microsoft's flagship language, I am having a hard time understanding why Microsoft isn't pushing C# to its fullest potential to give it more exposure via their market share? In addition can be interpreted as "Is C# ...

Interface + Extension (mixin) vs Base Class

Is an interface + extension methods (mixin) preferable to an abstract class? If your answer is "it depends", what does it depend upon? I see two possible advantages to the interface + extension approach. Interfaces are multiply inheritable and classes are not. You can use extension methods to extend interfaces in a non-breaking way. ...

Windows forms control library; Managed and Unamanaged

The windows forms control library project (C++) I writes uses an unmanaged dll. The unmanaged dll has a header file (a Cheshire cat). And I just include it in the control library project. And calls functions in the unmanaged dll (of course with proper marshaling). This compiles and builds. The problem is when I go ahead to add the contro...

YAML as a Data DSL in .NET (C#)

Anyone out there using YAML as a data DSL in .NET? I'd like to use YAML because it's more lightweight than XML. I intend to use this DSL as a "power user" configuration tool for one of my existing applications. My concerns: How is the support for YAML using one of the .NET community libraries? Does YAML have staying power? Will ...

Are VB.NET Developers Less Curious? Standardizing on VB.NET

I'm asking this question as someone who works for a company with a 70% to 75% VB.NET developer community. I would say 80% of those developers do not know what an OOD pattern is. I'm wondering if this is the best thing for the health of my company's development efforts? I'm looking at the tag counts on: http://stackoverflow.com/tags Ther...

Is there no simple way to set WPF StatusBar text?

I want to set the Text of a TextBlock in my StatusBar before making the user wait for a short moment while my program does a little bit of work. Aparently, instead of doing a nice little function like this (which does not work): Function Load(ByVal Id As Guid) As Thing Cursor = Cursors.Wait TextBlockStatus.Text = "Loading..." ...

Passing image throught wcf and display them in wpf datagrid

Whats the best way to pass an image in wcf service, and after passing it display it in a wpf datagrid? ...

Is there a reliable way to keep Compact Framework and Desktop projects in sync with Visual Studio 2008?

I am working on an SDK that is targeting both the Full/Desktop .Net Framework and the Compact .Net Framework. As such I have a solution that has projects for the Compact Framework and the full framework. The project files contain the same source files, or thay should. Some of the developers that are working on this SDK with me are onl...

Architectural question for tier .Net Development

Hi everyone i'm pretty new to the tiered development process. I'm currently developing an app and i have some basic questions regarding the best practices / architectural questions with todays technology. I'm going to be using WCF as the service layer. Note i'm trying to decouple things as much as possible. I don't want anything in the u...

How to add resource to existing signed assembly

Hello. Given: - an assembly (e.g. "SomeLib.dll") - a text file (e.g. "myconfig.xml") I need to embed the file myconfig.xml into the existing assembly SomeLib.dll Please consider before pressing "Answer": I know about resources embeding during compile (csc.exe .. /embedresource:file ... ). The thing is that I need to embed a resource ...

What are extension-methods -- and what makes them different from other methods? [Duplicate]

Duplicate What are Extension Methods? Usage of Extension Methods What Advantages of Extension Methods have you found? So I run into the term "extension-methods" frequently, when reading about .Net and intellisensing (!) around... What are extension-methods -- and what sets them apart from other methods? ...

Where to store application settings/state in a MVVM application

I'm experimenting with MVVM for the first time and really like the separation of responsibilities. Of course any design pattern only solves many problems - not all. So I'm trying to figure out where to store application state and where to store application wide commands. Lets say my application connects to a specific URL. I have a Conn...

Create a List View with Header sections

I would like to create a 'New Document' dialog similar to the Office 2007 style (see pic). I am having trouble with the list shown on the left. I have tried using a ListView control but I can't figure out how to display the header sections that scroll with the list (e.g. 'Template Categories' and 'Microsoft Office Online' What is my b...

HRESULT: 0x8004D00E using TransactionScope - C#

I received the following error when I tried to run a C# WinForms application on a Windows Server 2003 Standard Edition SP1 machine that was connecting to a SQL server 2000, converting the data in the WinForms app and inserting the converted into a SQL server 2005 application. I am connecting to each database using SSPI. The code was co...

Free Tools to Automatically Create UML Diagrams from an Existing .Net Project

Are there any free tools to automatically create UML diagrams from an existing .Net/Visual Studio 2005 projects? ...

Does Team Lead experience in one field / industry make it difficult to move to different field?

I have just been named team lead at my company-- I'll have two people reporting to me, but still doing software development. My specialty is in hardware automation and desktop software, but I would like to get into a role in a company doing ASP.NET, SaaS, or things like that. My question is to hiring managers: Would my experience as ...

UserControl as an interface, but visible in the Designer

So we have a C# WinForms project with a Form that contains a bazillion UserControls. Each UserControl naturally exposes all the UserControl methods, properties, etc. in addition to its own specific members. I've been thinking that one way to reduce the complexity of dealing with these UserControls is to access them through an interface...