.net

Finding best position for element in list

Hello, I have List collection that is populated in specific order (the requirement is that, this order can not be changed). This list contains entity type objects. After initial population of the list, I need to insert few more object, that are coming from another data source. These objects need to be inserted at specific position, so...

.net activeX equivalent

Is there a pure .NET replacement for ActiveX? I'm asking if there is a way for me to write a thick client side control to be loaded and interacted with in a web page in .NET, with NO com. Edit: I don't want ActiveX in pure .NET, I want a .NET alternative to ActiveX. ...

Lint for C#

Is there a lint-like tool for C#? I've got the compiler to flag warnings-as-errors, and I've got Stylecop, but these only catch the most egregious errors. Are there any other must-have tools (especially for newbie C#ers like me) that point out probably-dumb things I'm doing? ...

ListView items not rendering in GridView columns

I've got a ListView control bound to an ObservableCollection of items, and I've set it's view to a GridView with columns bound to properties Data. Things seem to be ok, but the data in the source properties aren't being rendered at all. Here's the ScanData struct: struct ScanData { public ushort Port; public bool? Status; ...

Hierarchy vs Merged List

Basically in my app I want to store all the nodes created by the user in a global list, say like: GlobalComposition = { collection } which will store nodes like: ImageInput01, ImageInput02, Blur01, Sharpen01, Contrast01, Contrast02 What I can't decide is whether I should store them in a linear "1 dimensional" collection, or only st...

Rewriting Existing Functionality in the .NET Base Class Library

Relating to another question I asked yesterday with regards to logging I was introduced to TraceListeners which I'd never come across before and sorely wish I had. I can't count the amount of times I've written loggers needlessly to do this and nobody had ever pointed this out or asked my why I didn't use the built in tools. This leads...

Unable to preview multiple page tiff files in .Net

I'm trying to preview and print multiple page TIFF files from a C# 2005 Windows application. Printing works fine but when I send my PrintDocument to a PrintPreviewDialog I get two images of the first page rather than an ameage of the first and second page. I also have the same problem when I use PrintPreviewControl. Below is code for ...

Run GC.Collect synchronously

GC.Collect appears to start the garbage collection in a background thread, and then return immediately. How can I run GC.Collect synchronously -- i.e., wait for the garbage collection to complete? This is in the context of NUnit tests. I tried adding the gcConcurrent setting to my test assembly's app.config file, and I tried the same wi...

Message box causes loss of focus

I have created a tool bar which has three controls. First one being a text box , an OK button and a Clear button. Essentially I am using this toolbar to search some text. When there are no results found , I pop up a message box informing the user that no results were found. But when the user clicks "OK" button of the message box, the tex...

Should I use a push or pull subscription if using RMO?

I have a CRUD winform App that uses Merge Replication to allow "disconnected" functionality. My question is; If I am doing all initializing and synchronizing programatically with RMO (like HERE) does it matter if it is a Push or Pull? What would be a difference? I understand the differences between the two (see HERE) but it seems ...

Collections for hierarchies

In the app I am writing, I am trying to find a way to store hierarchies effectively. Here is an example. At the bottom, you can see the nodes to be stored. Should I use multi dimensional lists? That doesn't seem very optimal, right? I was thinking holding references like so: node.Parent node.Children { collection } Anyone has experie...

Proper way to pause a System.Timers.Timer?

I'm looking at how to pause a System.Timers.Timer and I cannot figure out the proper way to pause it without resetting the timer. How to pause it? ...

Genetic algorithms in C#?

How can I write genetic algorithms in C#? Are there libraries available? Like C++: http://lancet.mit.edu/ga/ ...

IIS Application pool PID

is anyone familiar with a way to get the Application pool that is associated with a process ID ? I am using Win32_Process to query the W3WP services and return the PID now I am trying to get the app pool associated with it. ...

How to transform huge XML files into relational data to perform queries

I have at least 100 xml files each about 300 MB with email messages basically in the format listed below. Now my question is, how do I get this data into say SQL Sever database so that I can perform query on this data. My queries would be along the lines of: Has a certain person sent an email to another certain person on a given period...

Creating a Loop to Pause a Script While a Callback Function Operates

Hello All, I am currently using a third party component to handle telnet connections in .NET. I want it to be synchronous where I send a command to the receiving telnet server and then I get the response back as text or byte array. Only problem is that the component is not set up to do that. The component allows me to send commands t...

Running setup project (built in .NET) with admin privileges

Hi I have created setup project in Visual Studio 2008. How do I run this setup with admin privileges - I have tried Right-Click, run as administrator. Vista does not prompt me for password. Am I missing something? PK ...

Debugging ASP.NET MVC framework

What do I have to do in order to be able to step into ASP.NET MVC framework functions when debugging my own ASP.NET MVC application in Visual Studio 2008? I've currently installed the framework via the MSI installer. ...

How to attach a winforms dialog to an existing toolbar/menubar (compiled C++ app)?

To attach a winforms dialog on Microsoft Wordpad toolbar/menubar? ...

How do I configure base class libraries in my app.config file?

I've found a couple of snippets of information pertaining to app.config/web.config that hints at almost codeless configuration of BCL components directly through the app.config. However, given the amount of tags suggested by the intellisense within the app.config, it suggests that there is a huge amount of possibilities for this that I ...