.net

.NET Windows.Forms: How can I reverse all strings in text boxes whenever one of them changes?

I wrote a program that accepts and outputs Hebrew (i.e. right-to-left) text. In lieu of a Hebrew keyboard, the program has 22 buttons that allow the typing of Hebrew letters into one of the text boxes. (This has nothing to do with the problem, I think.) This program works fine under Windows using Microsoft .NET and Mono. However, in M...

A List of varying types?

Id' like to create a list of data that will be passed from method to method, however I can't use a struct because the data that will be contained in this list will vary depending on the input. For example if (x == 1) { a = 1 b = true c = 42 d = "hello" } if (x == 2) { a = 2 b = 'g' c = "sup" } I believe my o...

How do I handle painting for a DataGridView's editing control?

I have a DataGridView and I'm drawing TreeView-style dotted lines on the first cell of each row during its RowPostPaint event. When the first cell (which is a DataGridViewTextBoxCell) is in editing mode, the lines aren't drawn. How do I handle painting for the editing control? The standard editing control doesn't have a Paint event, a...

What are the .NET frameworks currently available that help build business applications ?

And what are their pros/cons in terms of maturity, community support, ease of development ?... In my mind, a business application framework should provide : ORM integration (possibly relying on existing solutions like NHibernate, the Entity Framework...). a validation library. UI integration components (ASP .NET and/or Windows Forms a...

C# byte array comparison issue

Hello everyone, I have two byte[] arrays in C#. And I am using VSTS 2008 + C# + .Net 3.0. What is the most efficient way to compare whether the two byte arrays contains the same content for each element? For example, byte array {0x1, 0x2} is the same as {0x1, 0x2}, but byte array {0x1, 0x2} and byte array {0x2, 0x1} are not the same. ...

Mysterious WPF exception: 'PresentationFramework.Eren Vista'

All of the sudden I am getting this mysterious FileNotFoundException exception inside my WPF project. It occurs right in InitializeComponent of my Window constructor: Could not load file or assembly 'PresentationFramework.Eren Vista, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies...

Array.Copy vs Buffer.BlockCopy

Array.Copy and Buffer.BlockCopy both do the same thing, but BlockCopy is aimed at fast byte-level primitive array copying, whereas Copy is the general-purpose implementation. My question is - under what circumstances should you use BlockCopy? Should you use it at any time when you are copying primitive type arrays, or should you only use...

.NET BindingSource Filter syntax reference

Hello, you can use the Filter property of a BindingSource to do SQL like filtering. for example bindingSource.Filter= "Activated = 1" but is there something like a documentation on the exact syntax of this? for example i would like to check if a field is not DBNull, so i tried "Field != NULL" but it gives a syntax error. thanks! ...

FTP downloading in .NET

Is there any built in functionality that enables downloading files from FTP in .NET? ...

Tools and techniques to optimize a LINQ to SQL query

I have a couple of LINQ to SQL queries that I feel take a lot of time. What tool and techniques can I use to first find out: How long they take and if there is room for improvement? Find out what I can change and easily test if those changes are effective? Both tools, techniques and reading resources would be appreciated (ergo up-vot...

sqlite DB not updating?

-edit- nevermind, i made a mistake in my select statement. Update was working correctly. I am not sure why but my sqlite DB isnt updating. I can see that this query returns 1 for a table that is affected but when i close my app or run a certain select statement it is as if this update never happened. 2 notes. 1) My inserts work fine, 2)...

How can I make Html.DropDownList encode its values?

In my viewData I have an IList mls. I want to use this to show in a dropdown. Like so: <%= Html.DropDownList("ml3Code", new SelectList(Model.Mls, "Code", "Description", Model.Ml3.Code ?? ""), Model.T9n.TranslateById("Labels.All"), new { @class = "searchInput" })%> This works fine, until there's a myObj...

Performance problem caused by ToolTip.

If the ToolTip is binded to the data operations takes a long time, the UI thread is blocked. Is it possible to solve this problem? The ToolTip should be shown optimal on idle and asynchronous. You can see the effect in the following example. <Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:io="clr-namespac...

How to improve performance of XtraReports using a web service to get the data?

Hello, I'm facing a potential problem using the XtraReports tool and a web service about performance. in a Windows Form app. I know XtraReport loads large data set (I understand a large data set as +10,000 rows) by loading the first pages and then continue loading the rest of the pages in the background, but all this is done with a dat...

DataGridViewComboBoxColumn name/value how?

I thought this was simple like in Access. User needs to set the value of one column in a datatable to either 1 or 2. I wanted to present a combobox showing "ONE", "TWO" and setting 1 or 2 behind the scene, like I did lots of times in Access-Forms. On the other side, if the table is shown it shall not show 1 or 2 but the corresponding ...

How can I subscribe to an event across AppDomains (object.Event += handler;)

I'm having the problem described in this message board post. I have an object that is hosted in its own AppDomain. public class MyObject : MarshalByRefObject { public event EventHandler TheEvent; ... ... } I'd like to add a handler to that event. The handler will run in a different AppDomain. My understanding is this ...

Can you shadow copy MAF Addins in ASP.NET

Is it possible to configure MAF in an ASP.NET such a way that it loads shadow copies of an addin assembly? I'd like the ability to update an addin without manually restarting the web server. ...

Jagged PowerShell array is losing a dimension when only one element exists

I have the following PowerShell function that works well for any input except for 1. If I pass it an input of 1 it will return an array with two elements 1,1 instead of a single element which is itself an array of two elements (1,1). Any ideas how I can make PowerShell return a jagged array with one element that is itself an array? fu...

How to find the transformed point3d coordinates of a transformed ModelVisual3D

I want to click on a model in a Viewport3D and find the 3D coordinates of a model. I want the transformed coordinates. Suppose you have this in a Viewport3D: <ModelVisual3D x:Name="yellowTriangle"> <ModelVisual3D.Content> <GeometryModel3D> <GeometryModel3D.Geometry> <MeshGeometry3D Positions="-1,0,0 0,1,0 1,0,0" TriangleIndic...

.NET: Writing one 2D array onto another

It would be easy enough to make my own system for this, but I'm figuring that the .NET library, being as massive as it is, probably already has a class made for this very purpose. For hit detection, my VB.NET game uses two 2D arrays that store the state of each pixel in the level. Each element in these arrays is a Byte (or, more accurat...