I don't claim to be a RegEx guru at all, and I am a bit confused on what this statement is doing. I am trying to refactor and this is being called on a key press and eating a lot of CPU.
Regex.Replace(_textBox.Text, "(?<!\r)\n", Environment.NewLine);
Thanks.
...
Why do I get, "Identifier 'Logic.DomainObjectBase._isNew' is not CLS-compliant"?
public abstract class DomainObjectBase
{
protected bool _isNew;
}
...
I need the fastest library to resize full size images (some up to 9MB in size) to multiple sizes.
Here's the scenerio:
User uploads a photo
a FileSystemWatcher is running in a service watching the drop location (on a SAN)
When a new photo appears, the service will create 4 versions of the image at full JPEG quality:
100px wide
320px...
Has anyone had a good look at the new Reactive Framework?
This implementation of "Linq over Events" was apparently distributed with the new Silverlight 3 Toolkit, as a way to manage asynchronous events.
This approach seems to be great at
handling events. One could attach an
IObserver to mouse events and record
them asynchronou...
I have a small (or perhaps not so small) issue with some ASP.NET/Castle Monorail sites for a product I work on. This is a fairly legacy system (written well before my time), and it uses GET requests with a considerable amount of information in the query string. We have recently run into query string length limitations, and for the amount...
I need to gather some system's information for the application I'm developing. The memory available and the CPU load are easy to get using C#. Unfortunately, the CPU temperature it's not that easy. I have tried using WMI but I couldn't get anything using
Win32_TemperatureProbe
or
MSAcpi_ThermalZoneTemperature
Has anybody already de...
I have a problem with a control leaking GDI handles.
This is the cut-down version of the control:
Public Class FancyLabel
Inherits Label
Protected Overrides Sub OnPaint(ByVal e As System.Windows.Forms.PaintEventArgs)
e.Graphics.TextRenderingHint = Drawing.Text.TextRenderingHint.ClearTypeGridFit
MyBase.OnPaint(e)
...
We are in the initial phase of trying to implement TDD. I demo'd the Visual Studio Team System code coverage / TDD tools and the team is excited at the possibilities. Currently we use Devpartner for code coverage, but we want to eliminate it because its expensive. We have very limited experience in TDD and want to make sure we don't go a...
I would like to display a "wait cursor" to the user when they have to wait for something to load. The cursor should be an animated series of bitmaps.
I can use a UserControl that I can add to a form, but the UserControl is not itself transparent.
I took the code sample available here (http://www.microsoft.com/downloads/details.aspx?Fa...
I've a webbrowser control and I'm trying implement IDocHostUIHandler in the container. However since I don't have a default IOleClientSite I can't forward all events to a default container.
And I couldn't find a way to response all of them, giving wrong responses to some of the events or not doing anything causing application to crash.
...
How can I use window.external after using SetClientSite in Webbrowser Control without implementing IDocHostUIHandler?
...
Hello,
I am using C# 2008 SP1
I developed a program that will be run on several user computers, ranging from a few hundred to a few thousand.
What is the best way to download the files to update the user program HTTP or FTP?
Also, are the security issues related to each protocol?
Many thanks
...
I have an InfoPath 2007 form with custom .NET code. In order for it to be accessible on our Sharepoint server, it needs to run in full-trust (I get an error about the form trying to access my computer, and therefore it cannot run). In order to run in full-trust, it needs to be signed with a cert. The network admin sent me a cert, but ...
Besides the service.StartType = ServiceStartMode.Automatic my service does not start after installation
Solution
Inserted this code on my ProjectInstaller
protected override void OnAfterInstall(System.Collections.IDictionary savedState)
{
base.OnAfterInstall(savedState);
using (var serviceController = new ServiceController(thi...
When I display a WPF window with WindowStyle="None", it looks great when using areo.
However, when I use luna or classic, it displays an ugly gray border about 5 pixels wide.
Of course, if I set ResizeMode="NoResize", this border disappears but I would like the window to be resizable (ResizeMode="CanResize").
Other non WPF application...
How does the OleDbConnection constructor know what provider DLL (I assume it's a DLL) to call for a given provider name in the connection string? For example, in the following code...
string cnStr = "Provider=Sybase.ASEOLEDBProvider.2;Server Name=etc...";
OleDbConnection cn = new OleDbConnection(cnStr);
How does OleDbConnection know w...
Can someone please explain the following Argument Exception : The structure must not be a value class to me please.
It's being cause by the following line of code in my program:
Marshal.PtrToStructure(m.LParam, dbh);
given that dbh is of type:
[StructLayout(LayoutKind.Sequential)]
public struct Device_Broadcast_Header
...
I have this .NET application which use Settings.settings and app.conf as configuration repositories instead of the Windows Registry. It seems pretty easy to ask questions to the user during the installation and write the responses to the Windows Registry, but I have not found yet a way to write the responses to the app.config file. Does ...
We have a "print engine" which basically picks pre defined tasks to run against a file and these "tasks" are .NET 2.0 - 3.5 (in C#) command-line applications.
All it does is run one after the other and with the applications that we haven't developed internally, they run quite quickly, typically 10-30 ms.
However, our .NET applicati...
Hello. I have the following code:
try {
fi.MoveTo(getHistoryFileName());
} finally {
Debug.Write("Move complete");
}
I thought that using this would make sure that I'd never have exceptions thrown, but I am getting IOExceptions sometimes. What is the reason?
...