.net

Problem with focus in WPF

I have a WPF application which contains a WindowsFormHost and a DataGrid. Inside the WindowsFormHost there is a Windows Form User Control. The DataGrid selected item is binded to a property in the ViewModel. If the selected item changes while I'm holding down the left button of the mouse over the User Control, I lose the focus. Is ther...

WebOperationContext behavior for non REST WCF Services?

What happens in my service method if I use a WebOperationContext, when the endpoint is not REST? Justification: I have a service that I'm exposing as both REST and SOAP. ...

I have a custom type which I want to serialize, this custom type accepts input which might consists of escape chars.

I have a custom type which I want to serialize, this custom type accepts input which might consists of escape chars. M1_Serilizer(MyCustomType customTypeObj) { XmlSerializer serializer = new XmlSerializer(typeof(MyCustomType)); StringWriter sw = new StringWriter(CultureInfo.InvariantCulture); serializer.Serialize(sw, customT...

Trying to set PC clock programmatically just before Daylight Saving Time ends

To reproduce : 1) Add Microsoft.VisualBasic assembly to your project reference 2) Change PC timezone to : (GMT+10:00) Canberra, Melbourne, Sydney . Ensure PC is set to automatically adjust clock for daylight savings time. (For this timezone, daylight savings time ends at 3am on 4 Apr 2010.) 3) add following code : public void Se...

Suppress missing assembly error in Setup and Deployment Project (msi)

Hello, To install windows services on our client's site I'm using msi setup files created with Setup and Deoployment Project (VS2008). I'm using loose installation so assemblies are not packed but rather visible in the folder structure. The problem is that our solution contains projects specific to particular clients (in other words th...

SharpSvn marks file as missing but I need deleted

I want to delete file in svn. I do this so: svnClient.Delete( pathToFile, new SvnDeleteArgs {Force = true} ); When I want to commit chenges, in svn file status is 'missing', but I need 'deleted'. What I do wrong? ...

Dock Panel component for .NET that allows docking inside tab-pages?

I want to build a user-interface that, for historical reasons, has a lot of "columns" of information. Many of these aren't relevant for all users in all cases, so I thought I'd look at dock panels to allow the users to hide or rearrange the columns according to their job scenario. This is Winforms in .NET 3.5. As such, I'd like the fol...

vb.net and html parsing

Currently I'm using the IHTMLDocument2 and IHTMLElementCollection to parse HTML, is there some way to parse it using some sort of xpath/selectors, something like elements = find_html_elements("a .link[rel=100]") ? ...

multi threading wpf

Hey, I'm using web refernce call in new working thread in my application as follow: Thread callRunner = new Thread(delegate() { _mediator.IncomingCallDetails(phoneNumber); }); callRunner.Start() ; the _mediator calls the web refernce and replay to the caller in event as follow: void IncomingCallComplited(IncomingCallEve...

Name the pattern - Create, Set, Execute, Destroy?

I somewhere heard that the .NET Framework was built around specific pattern, which they tried to uphold as much as possible. var rsa = new RSACryptoServiceProvider(); // Create rsa.ImportParameters(GetParameters()); // Set byte[] encrypted = rsa.Encrypt(data, true); // Execute // Destroyed by garbage-collector Are there any variants o...

indicate truncation in ToolTipStatusLabel automatically

I have a .NET application with a StatusStrip holding three ToolTipStatusLabels. The Text of the labels are filled from the application as they show the status. For some circumstances they can hold an empty text. When I resize the window, the ToolTipStatusLabels are hidden when they cannot be fit in the StatusStrip. I would like to have ...

Architecting a generic search result web control

In a project I'm currently working for we've stumbled upon the need for several kinds of search results presentation controls. The search result are similar, but not identical. For example, in the "office search" result we might want to present the office name and location, while in the "document search" could contain document name, auth...

Pass through more then one argument with a Javascript .NET postback

I have implemented the javascript function that allows me to do a .NET (4.0) postback Javascript _doPostBack('_Page', argument) C# public void RaisePostBackEvent(string eventArgument) { //something happens } Is it possible to pass through more then one argument? ...

Null and blank values

What's the best way of writing robust code so that a variable can be checked for null and blank. e.g. string a; if((a != null) && (a.Length() > 0)) { //do some thing with a } ...

Handle clipboard copy on UserControl.

Hi, I have complex UserControl (grid, edit controls for grid, etc...) and I want handle CTRL+C keyboard shortcut, however I don't want disable a native functions by edit controls (textboxes, comboboxes, etc...). If the CTRL+C is not handled by other inner controls I want handle it by myself (copy whole row(s) from grid, etc...). I trie...

ObjectDataSource Insert and Update methods error

I m developing asp.net 3.5 project. When I want to Insert with DetailsView this error occured: Error : ObjectDataSource 'ObjectDataSource2' could not find a non-generic method 'AddCity' that has parameters: CITY_NAME. <asp:ObjectDataSource ID="ObjectDataSource2" runat="server" SelectMethod="GetCityByID" UpdateMethod="UpdateCity" Inse...

What is the quickest way to import 60m records into SQL

I have a 5-6 tables in my database that I need to populate with test data to test peroformance in my app. I can write a code and do a bulk insert my prediction is that it will take nearly 3 days to run so I assumed there must be a quicker way. Any ideas? ...

Using C# and VB.NET in one solution

I'm busy on a small project to convert an Access2003 db to .NET. I am trying to integrate my functionality in an excisting project that is being used for Administration of some kind. The code in this project is vb.net. I started by setting up my Data Access Layer, which seems to work fine. I can make new web pages that acces the data I...

WPF XAML Bind Grid

I have a custom user control that is based on a Grid control. I have a ViewModel that exposes this as a property. I would like the XAML on the view to bind to this. I am sure this must be easy but I am quite new to WPF. How is this achieved? Many thanks in advance (Edited to add more info) Example of view without binding to ViewModel....

How to make a DropDownList control display some items in bold ASP.NET

I'm working with a custom DropDownList control in ASP.Net and there's been a request to display certain items in the list with a bold typeface (NOTE - the control inherits from CompositeDataBoundControl so it can be data bound... not DropDownListBox). The control is bound to a table and there's a column in the table named IsUsed - if th...