.net

With so many application variations, how to choose which one to specialise in

I was sat infront of Stackoverflow last night and I was dumbfounded with the number of individual tags. It got me thinking about how many different flavours of applications there are out there. Personally, I'm a C# man but even I'm finding that with WCF, WPF, ASP .NET 4, Silverlight and MVC, there is getting so much choice and am begin...

Get content from cell

Hi! I have UltraGrid and i need when i click on grid row to get content from specific column of that grid. For example if I click in cell of fourth column then i need to get value of first column of the same row where i clicked. Thanks! ...

Microsoft.Office.Interop.Word documentation

I need to use the Microsoft.Office.Interop.Word namespace to extract if a Word document contains macros, and which ones. The MSDN documentation for this namespace doesn't give much information compared to the documentation on other .Net classes. Where can I get more informations about this namespaces (examples, complete documentation, et...

WPF ListBoxItem Selection

Hi, Say I have a WPF XAML code as below <Grid> <Grid.ColumnDefinition> <!--2 Columns are defined--> </Grid.ColumnDefinition> <Button x:Name="button" Grid.Column="1"/> <ListBox x:Name="listBox" Grid.Column="2"/> </Grid> Now, each listboxitems are bound to an object of a class with a member named "Stat...

Custom .ToString() Formats in .rdlc Reports

I have a custom business object which overloads the .ToString() function. It also implements IFormattable.ToString, so I can define my own custom formats. This approach seems to work everywhere in my app, except .rdlc reports. For example, I have a text field on a report with the following expression: =Fields!MyField.Value.ToString("lr...

IIS6 Wildcard mapping breaks .net custom errors

We use a custom urlrewiter on our .net sites and set a wildcard mapping to redirect any request to the .net isapi filter for processing. This works fine but we have noticed an issue with our custom 404 pages not working and iis handling the 404s instead. We configure the custom errors in the web.config as follows <customErrors mode="O...

Wpf: Alternative to xaml.cs file containing only deafult constructor and InitializeComponent() call

I use MVVM. Is there any convenient way not to have xaml.cs files but somehow still calling InitializeComponent()? ...

Protected Set in VB.Net for a property defined in an interface

We have an interface, which can be grossly simplified as: public interface IPersistable<T> { T Id { get; } } Most places that implement the interface want to have it so that there is a protected or private set on that property, i.e, in C#: public class Foo : IPersistable<int> { public int Id { get; protected set; } } Howeve...

Setting Focus to a .NET UserControl...?

I'm creating a custom control derived from UserControl that I would like to set focus to. The custom control contains a ComboBox control and I draw some strings beside it. The ComboBox can receive focus, but I would like to be able to set focus to the UserControl itself. My OnPaint handler is set up to draw the control slightly differ...

How can I return more than one object of different type in C# .net?

Hi, I have two objects and I dont want to create a wrapper class to have data of this two object, no 'Out' parameter is there any way that I can return more than one object of different type? Will really appreciate it!! Thanks ...

Nullreferenceexception when adding a GData.Extensions.Reminder to Reminders

Hello again, I think the title says it all. I'm using Reminder fifteenMinReminder = new Reminder(); fifteenMinReminder.Minutes = 15; fifteenMinReminder.Method = Reminder.ReminderMethod.email; entry.Reminders.Add(fifteenMinReminder); on a brand new entry (where Reminder and Reminders are Nothing), but I cannot add a reminder using the ...

TcpListener.Start() does not open the port

Hello, I have a class that inherits from the TcpListener, this class Shadows the Start method just to call the base Start() and the base BeginAcceptTcpClient(). From time to time the method is called but the port is not opened (netstat does not show the port open). The class looks like this Public Class ExtendedTcpListener Inherit...

Property grid item and DoubleClick.

Hi, I'm using PropertyGrid control for editing some objects in my application. I'm using custom TypeConverters and TypeEditors for better user interface. I have problem with custom TypeConverter for boolean properties. If I have this class: public class MyClass { public string Name { get; set; } [System.ComponentModel.TypeCon...

.NET localization tool - free or full-featured trial

I'm looking for a tool to automate the process of localizing one software product. Is there any free, or trial version with no limits other than time? ...

Discovering derived types using reflection

Using reflection, is it possible to discover all types that derive from a given type? Presumably the scope would be limited to within a single assembly. ...

Regular Expression

I want regular expression that checks that the string doesnt start with an empty space. Some what like this i want to do : Is the below ValidationExpression right for it : string ValidationExpression = @"/^[^ ]/"; if (!String.IsNullOrEmpty(GroupName) && !Regex.IsMatch(GroupName, ValidationExpression)) { } ...

Why doesn't Đ get flatten to D when Removing Accents/Diacritics

I'm using this method to remove accents from my strings: static string RemoveAccents(string input) { string normalized = input.Normalize(NormalizationForm.FormKD); StringBuilder builder = new StringBuilder(); foreach (char c in normalized) { if (char.GetUnicodeCategory(c) != UnicodeCategory.NonSpacingMark...

Write in "ProgramData" folder (W7 and Vista) .NET

Hi I install my app under "Program Files" directory. And I install data, under "ProgramData" directory: Environment.SpecialFolder.CommonApplicationData In programData I have created folder to save data. Example: C:\ProgramData\MyApp\MyData\here I have files and folders Under XP all runs fine. But not under Vista or W7 OS. I can rea...

multple datalists

can any one tell me how can i add multiple DataLists that dsplays diffrent dataset values on each DataList? actually i want the Data to be appeared on the DataList are Diffrent at diffrent action. ...

Nant cant find assembly in the GAC

Hi, I have a .Net project which uses the MySQL connector which is located in the GAC. In my Nant build file there doesnt seem to be a way to tell CSC to look in the GAC to find this dll (or type information) and my project wont build. Is there a way to tell Nant that this reference does exist and its in the Gac. Its wierd really becau...