.net

Wrapping Web-Services for COM

I have zero experience with COM. I actually never thought, I'll need to do something with COM, thinking it's something that I luckily managed to avoid. Oh, well. I need to create a wrapper for Web Services, which could be used from COM. I was hoping, that it's a solved problem, but failed to find an easy solution (for example: just gene...

.NET MissingMethodException occuring on one of thousands of end-user machines -- any insight?

This issue has me baffled, it's affecting a single user (to my knowledge) and hasn't been reproduced by us... The user is receiving a MissingMethodException, our trace file indicates it's occuring after we create a new instance of a component, when we're calling an Initialize/Setup method in preparation to have it do work (InitializeWo...

What to do if the head tag to make IE8 Emulate IE7 does not work?

Following the advice of the following post, I added the following code to one of my client's websites in .NET. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" /> For some reason the website is still not displaying the menus correctly. If I g...

Sort List alternative in c#

I have a number of objects, all from the same class(ColorNum) Each object has 2 member variabels (m_Color and m_Number) Example: ColorNum1(Red,25) ColorNum2(Blue,5) ColorNum3(Red,11) ColorNum4(White,25) The 4 objects are in the ColorNumList List<ColorNum> ColorNumList = new List<ColorNum>(); Now I want to order the list so the obj...

How do you stop DataGridView calling IDataErrorInfo.this[string columnName] get?

I have a data object that implements IDataErrorInfo however the validation logic is a bit slow. Not that slow, but slow enough you don't want to call it a large number of times. In my application a list of these objects gets displayed in a DataGridView control. The grid is read-only and will only ever contain valid data objects, however ...

WPF/Silverlight - Prism - Resources for beginners

Official Websites Composite Application Guidance for WPF and Silverlight patterns & practices: Composite WPF and Silverlight Articles Composite Web Apps With Prism Podcasts PRISM for Silverlight - Connected Show Videocasts SlickThought.Net - Jeff Brand dnrTV Brian Noyes on Prism Brian Noyes on Prism Events and Commands ...

Need advices designing a .net control.

I need to create a user control, that will be used in an application used to schedule employees tasks. The control will be a two dimensions table. There will be one line for each employees. On this line, there will be 0 or more block that each represent a task this employees has to do. They will be ordered from left to right so the ones ...

Determining if a file has write access in .NET

I have created a software product, that acts like the Apache mod_rewrite, but for .NET. One of the requirements is to support the RewriteLog command which sets a path for logging. This works fine, however the biggest issue I run in to is that users set a path that the IIS user doesn't have access to. I would like to throw an excepti...

Extracting generic Linq queries

I'd like to use Linq to SQL in my windows form application. The data in the local database is fetched from the Web Service or created locally. If an entity was fetched from the Web Service it has ExternalId set up I frequently need to use code as below to fetch objects by theirs ExternalId: var user = (from u in db.User ...

Custom .NET Serialization doesn't seem to work

I am using BinaryFormatter to serialize a collection of objects of class A stored in a System::Collections::Generic::List<A^>^. I have added the [Serializable] tag and have implemented ISerializable in class A (both GetObjectData and the special constructor). When deserializing, I find that the list is deserialized and contains the same ...

Right reporting solution in a .Net environment

I have a reporting requirement in my web application for which I am looking for off the shelf solution. I don't have any experience of reporting softwares so thought of checking with SO community if anyone have any idea of reporting solution which fits my requirements. The application will be developed in .Net and apart from other funct...

Regular expression, split string by capital letter but ignore TLA

I'm using the regex System.Text.RegularExpressions.Regex.Replace(stringToSplit, "([A-Z])", " $1").Trim() to split strings by capital letter, for example: 'MyNameIsSimon' becomes 'My Name Is Simon' I find this incredibly useful when working with enumerations. What I would like to do is change it slightly so that strings are only spli...

.Net stop listening socket

I have a windows service written around some code similar to this Asynchronous Server Socket Example Everything works great. Client/Server communication works perfectly. No issues at all. When I try to shutdown the windows service, I can't stop the server socket listener without getting the following error: A request to send or r...

How to display ClickOnce Version number on Windows Forms

I have a windows forms application that is deployed to two different locations. Intranet - ClickOnce Internet - Installed on a citrix farm through Windows installer I display ClickOnce version number for click-once deployed versionApplicationDeployment.IsNetworkDeployed. if (ApplicationDeployment.IsNetworkDeployed) return Ap...

C# Microsoft Chart Control/Dundas Charts Clear Contents!?

Hello! I am using the Dundas Chart Controls/Microsoft Chart Control for .Net. Currently I have a method which populates the chart control with date from a generic List. Lets say for example that I populate the chart with data from one list. Then I want to populate the chart with data from another list. The problem I have is that when p...

No-op lambda

I have an event on one of my classes that I want to attach a handler to. However, I don't need the handler to do anything, as I am just testing the behaviour of the class with handlers attached or not. The event signature is as follows: public event EventHandler<EventArgs> Foo; So I want to do something like: myClass.Foo += (); Ho...

Is it possible to programatically add some controls to a WinForm?

Hi folks, i have a pretty simple rectangluar WinForm that uses timers to check the end content of a number of files. Works fine. Now, the list of files to check is dynamic. Could be 3. could be 30. It dependant upon some value in the database, which i check regularly. That's also fine. What I wish to do is visual this, on my winform. ...

Generating indexes in Linq

I'd like to use Linq to XML to output a sorted list each element should contain a value and its index on that list. In other words I would like to do something like this (xml stuff was striped out): var Sample = new[] { "4", "3", "2", "1" }.AsQueryable(); var r = (from o in Sample orderby o select new {obj=o, idx=?}); I'm not sure ...

WPF BackgroundWorker ListView Filter Issue

I have a WPF ListView that I am trying to filter within a BackgroundWorker. My code is shown below: Dim Worker As New BackgroundWorker AddHandler Worker.DoWork, AddressOf Me.FilterAsync Me.TextBoxText = Me.TextBox.Text Worker.RunWorkerAsync(Me.TextBox) Private Sub FilterAsync(ByVal sender As Object, ByVal e As DoWorkEventArgs) ' ...

C# and Text file into a typed dataset

Is there any way to load a text file (edi, efi file) into a typed dataset? I thought you could do this using linq but have yet to figure how. Anyone have any suggestions? ...