Hi All,
Let's consider the two following lines in C# (using framework .NET 3.5)
Regex regex = new Regex(@"^((E|e)t )?(M|m)oi (?<NewName>[A-Za-z]\.?\w*((\-|\s)?[A-Za-z]?\w{1,})+)$", RegexOptions.Compiled | RegexOptions.IgnoreCase);
Match m = regex.Match("moi aussi jaimerai etre un ordinateur pour pas m'énnerver ");
(sorry it's a frenc...
I have an XML stored procedure in MS SQL 2005 which I use the SqlCommand.ExecuteXmlReader to get an XmlReader, then parse through the data and form an XML document. The problem is that the data in SQL contains some binary characters which are illegal within a UTF-8 XML document, so an exception is thrown.
Has anyone else dealt with this...
Hy.
I have got a ListBox with a scrollviewer in it. Each item (40++ items) of the listbox contains a textblock and a small image.
When I resize the window, the resizing is very laggy. If I put the textblock visibility of the items to "collapsed", the resizing is okay. My first approach was to set the visibility of each item not display...
Let me preface this with I am an experienced .NET developer--but I have not yet worked with SharePoint, so this question relates directly to SharePoint and its features.
I'm working on a project that requires integration with SharePoint to the extent that a user can click some kind of redirect link that would allow them to authenticaate...
What's the simplest/canonical way to create an empty file in C#/.Net? Simplest way I can find so far:
System.IO.File.WriteAllLines(filename, new string[0]);
...
I developed a win forms app targeting .net 2.0. All of this is in Visual Studio 2008 sp1.
I did this because I didn't really need 3.0+ features in the app. and I didn't want the clients to have to install a gigantic framework when they could just install a semi-huge one.
Well, when I create a setup project for the app, build it, instal...
In my datasource there are a lot of special characters like forward slash, minus, plus etc. A lot of these characters bring problems to lucene.
That's why I decided to encode all the strings I put in the index.
For example apple/pear would become apple%2Fpear
I would imagine that searching for the very same string would then return me t...
I'm trying to serialize an object to XML that has a number of properties, some of which are readonly.
public Guid Id { get; private set; }
I have marked the class [Serializable] and I have implemented the ISerializable interface.
Below is the code I'm using to serialize my object.
public void SaveMyObject(MyObject obj)
{
XmlSeri...
In WinForms, to set focus to a specific control, I always seem to wind up calling Control.Select() and Control.Focus() to get it to work.
What is the difference, and is this the correct approach?
...
I'm developing in C# on the Castle stack. I'm new to unit testing, and I've heard that a more flexible language (than C#) might make writing tests easier.
Do you think it is worth the time to learn Boo just for writing unit tests?
We use the SharpDevelop IDE, so have Boo support available, and I've kind of been looking for an excuse to...
I'm working on a Windows Service that watches a few folders for changes, creations, and deletions. It all works well with the exception of one watcher that watches a single file (XML File with Configuration Settings) for minor changes.
I tried taking the Windows Service code and putting it into a simple windows application with start/s...
I have just installed the .NET 3.5 Framework to my Windows 2003 server and when I try to create a new website I can't select 3.5 from the web site properties ASP.NET tab in IIS.
This works fine with 1.0, 1.1, and 2.0.
I know the framework install process was completely different with 3.5, but I assume it should be available in the drop...
I have a disabled TextBox that I am editing the value of on the client side with JavaScript. When I try to retrieve the value on the server side it does not reflect the change made on the client side. If I set the TextBox's enabled attribute to true I can retrieve the value, but the user is able to put focus and edit the TextBox.
Is the...
Hi!
I have the following scenario:
Entities are loaded from the database.
One of them is presented to the user in a Form (a WPF UserControl) where the user can edit properties of that entity.
The user can decide to apply the changes to the entity or to cancel the editing.
How would I implement something like this with the EntityFram...
I've got a stored procedure that returns two possible result sets. If successful, it returns a 0 (int). If it fails it returns -1 and a table containing a list of errors. I'm trying to figure out how to deal with this using LINQ.
I found Scott Guthrie's post about this, but he was using results that were mapped to types/tables. I had t...
On my journey to learning MVVM I've established some basic understanding of WPF and the ViewModel pattern. I'm using the following abstraction when providing a list and am interested in a single selected item.
public ObservableCollection<OrderViewModel> Orders { get; private set; }
public ICollectionView OrdersView
{
get
{
...
I understand the purpose of events, especially within the context of creating user interfaces. I think this is the prototype for creating an event.
public void EventName(object sender, EventArgs e);
but I don't understand event handlers, specifically what they do, why they're needed, and to create one. Could someone please enlighten m...
Hello,
I’m looking for a code snippet that would programmatically format unallocated space on a given drive.
I’m ideally looking for .net code (VB.NET C#) or C++.
Many thanks
...
I have built a setup project for deploying my windows forms app. I want to take all of the files that are needed to deploy (setup.exe, whatever.msi, & prerequisites) and package them in a single self extracting archive.
Ideally the user would run this exe, it would extract files to temp directory, run setup.exe, and delete the files aft...
System.Collections.Specialized.NameObjectCollectionBase has two similar properties:
string[] AllKeys
NameObjectCollectionBase.KeyCollection Keys
Do they provide different sets of data? When would I want to use one over the other?
...