.net

DuplicateFilter for lucene.net?

Today I found this document about the DuplicateFilter. That would be exactly what I need right now, but I can't seem to find it in the .net port. Is it there at all? ...

GC.Collect in a loop?

I found this piece of code inside System.Web.ISAPIRuntime using Reflector public void DoGCCollect() { for (int i = 10; i > 0; i--) { GC.Collect(); } } Can anyone comment on this? Is there a reason to do GC.Collect() in a loop? Why 10 times and not 3, 5 or 20? Analysis indicated that it's not used inside .net framew...

How do you take a Screenshot of a website via .Net code?

Is it possible to take a screen shot of any given url using .Net code? What is the easiest way to do it? ...

.Net database message brokering

I'm looking for a simple and reliable mechanism to perform application message brokering from the database level. I basically need changes in two distinct applications to generate messages to each other to indicate that changes have occurred between their common objects. The difficulty lies in the fact that both systems have their own un...

Swapping left and right mouse button in .NET

How do I swap left and right mouse buttons in .NET (preferably C#)? Basically the result should be the same as if the user checked the "Switch primary and secondary buttons" checkbox in the Mouse Properties through the control panel. I'm dealing with Windows XP, in case that makes a difference. ...

SOAP Request Timeout in Console App (.NET)

I have a SOAP web service added to a console app and every time I make a specific call its timing out on me. Other calls work fine. How do I increase the timeout length in a console app? Seems like it's currently about 90 seconds. Thanks. ...

Is there a Breakpoint Plugin for Visual Studio?

Background In some sufficiently large applications, you can spend more time figuring out how to drill down to the various layers than you do actually debugging: That's the case with a piece of software I work on now. Layout/separation of concerns issues aside, it'd be nice to have a breakpoint plug-in that would allow you to load break...

Separated string created in loop

I'm searching the best way to create a string separated with another in a loop. I mean, for example, SQL reader: StringBuilder sb = new StringBuilder(); while(reader.Read()) { sb.Append(reader[0]); sb.Append("<br />"); } string result = sb.ToString(); result = result.Remove(result.LastIndexOf("<br />")); // <- or creating SQL quer...

DllImport with different entry points (different DLLs for the same import in different projects)

As a follow-up to my recent question about .NET Compact Framework debugging, I am currently trying to use OpenGL ES from both a .NET Compact Framework and a .NET Framework application. I use this wrapper, which has been created for OpenGL ES and imports from libGLES_CM.dll. To make debugging easier, I created a .NET Framework applicatio...

How do I skip an iteration of a `foreach` loop in C#?

In Perl I can skip a foreach (or any loop) iteration with a next; command. Is there a way to skip over an iteration and jump to the next loop in C#? foreach (int number in numbers) { if (number < 0) { // What goes here to skip over the loop? } // otherwise process number } ...

Wanted: Cross-process synch that doesn't suffer from AbandonedMutexException

I have several threads that acquire Mutexes and then terminate. The mutexes are stored in a main repository, and are properly released when the program exists. However, when the thread that allocated a Mutex exists, the mutex gets released automatically, and subsequent acquire AbandonedMutexException (also according to the documentation...

How to reduce memory consumption by an application in Task manager

Hi I have developed a winforms application using C# in VS2008. When I run this application I observed in task manager that it shows 80 MB of memory is consumed. How can I reduce this? Even very small applications also take 8 MB of memory... What can I do to reduce the memory footprint? Thank you very much in advance. ...

.NET One Hop Rule and SharePoint Webparts

Hi I have a SharePoint webpart which is compiled as a DLL and placed in the BIN folder of my SP site. My webpart works on my local machine, but when I put it on production it fails with a (401) Unauthorized. After doing some research I came acrooss what is known as the "One hop rule". Meaning I have to either pass in the credential...

How do I find out whether a control is currently invalidating?

I'm writing a custom DataGridView cell class that hosts a control. I'm listening to the Invalidated event to know whether I should reposition and repaint the cell, but I'm getting loops because repositioning the cell can invalidate other hosted cells, which then invalidate the first one, and so on. I don't want to use a static member t...

Can I have an 'offscreen' control?

I'm trying to create a DataGridView cell class which hosts a control (all the time, not just while editing). So far, my approach has been to add the control to the grid and try to synchronise its position with that of the cell. Would it be possible instead to keep the cell offscreen, route mouse and keyboard events to it, and paint it ...

Programatically detecting Release/Debug mode (.Net)

What's the easiest way to programatically check if the current assembly was compiled in Debug or Release mode? ...

Outlook navigation bar control for .NET application

Is there is an open source or free control like the Outlook Navigation control? I want to add one to my .NET application. Update1: I am not using WPF. I need control for windows form only and i am using .NET Framework 2.0 ...

SQLDatasource CommandTimeout not working

Good day, I'm using a SQLDataSource with a dynamic query generated c#, based on user choices in many fields. However, since our tables are very large, sometimes, I get a command timeout exception. I tried to set the property in 'Selecting' of the SqlDataSource like so: protected void SqlDataSource_PSearch_Selecting(object sender, Sq...

Implementing MVC with Windows Forms

Where can I find a good example on how to completely implement the MVC pattern in Windows Forms. I found many tutorials and code examples on various sites (e.g. CodeProject, .NetHeaven) but many are more representative for the observer pattern than MVC. Since the application I want to develop is for a school project, I am reluctant to us...

Using a C++ header with .NET language

I trying to use a ".h" file from Windows SDK in a .NET language (maybe C#), but without success. This header exposes some Windows Media player functionality through COM. If I use Win32 C++, I can use it with no problems, so I thought that I could use Managed C++ as a "Bridge" to expose it to C#. The header file is the subscriptionservic...