.net

table-like widget or control which content can be edited

Hello guys, is there any table-like widget or control which content can be edited in the .NET Compact Framework 2.0 using Visual Studio 2005? (we could change to a newer version if it need to be) Otherwise it would be okay if it is possible to identify the column and row in an onClick-event to open an TextBox. I'm afraid I found nothi...

ICloneable Vs Strongly Typed Function Vs Being Lazy

Hi Folks I need to deep clone some custom objects that references other custom objects and these may reference other cust... and so on you get the idea. I'm just at the documentation & conception stage at the moment so wan't to get it right. Q1. Why implement ICloneable and return an object when you could write a strongly typed custom ...

Is there a way to get the "significant figures" of a decimal?

Update OK, after some investigation, and thanks in big part to the helpful answers provided by Jon and Hans, this is what I was able to put together. So far I think it seems to work well. I wouldn't bet my life on its total correctness, of course. public static int GetSignificantDigitCount(this decimal value) { /* So, the decimal t...

Custom exceptions with error codes in .NET Web Services to Client

I'm trying to throw custom exception from a web service and trap it on the client side. I'm using JQuery and getting the JSON-serialized exceptions, so that's a good start. However the problems are: Stack trace is sent to the client which i don't want. I need to add an error code in addition to the exception message. I've tried creat...

Transaction when writing to database and create an database

Hi we are building an multi tenancy solution where each tenant will have its own database. We will keep the information about the tenant in an index database. When creating an tenant the following steps will be made. Create Tenant class, save it to the database where it will get an incremental number which will be used to name the datab...

Is there a collection in .NET that works as a dictionary and list at the same time?

What I want is basically a collection that's a hybrid of a dictionary and a list. I want a collection that I can add key/value pairs to (like a Dictionary), but at the same be able to retrieve the values (without the keys) in the same order I added them (like a List)? Does such a collection exists in .NET? Thanks ...

File version vs. assembly version

I have a .NET (FW 2.0) library which is used by a COM (vb6) application and also by a .NET application. The TLB generated for COM is registered which a version consisting of the first two digits of the "assembly version". For example, 1.2.5.7 assembly version becomes version 1.2 of the TLB. This is very inconvenient, because sometimes ...

Can I read and write a FIFO from concurrent threads in .NET?

I'm using a Queue<T> for caching video. The idea is to fill it with data (Enqueue), start playing (Dequeue) and fill back continously as data arrives. Can I do the filling back part from a background thread? ...

BitArray - Shift bits

I have a System.Collections.BitArray array (~3000 items) and I would like to shift all the bits to the left by 1. However the collection doesn't seem to support that operation (i.e. bitArray << 1 not working and there is no method). Any idea on how to do that? Thanks! ...

Synchronize Read Write Collection in .NET

I have an object which holds a collection of items. I want to be able to add items to the collection through an AddItem method and also to go through all of the items in the collection. My object must be thread safe. I am using a ReaderWriterLockSlim to assure proper synchronization. How should I synchronize the GoThroughAllItems method?...

WPF ListView.ItemsSource Binding Problem

I have a MainViewModel and Customers property (list of CustomerViewModel objects as an ObservableCollection) inside it. I want to bind that list as a ItemsSource to ListView Control. My MainViewModel is bound to Window's DataContext property. I used ServiceLocator pattern in order to create MainViewModel instance which gets an IDataServi...

Error generating proxy class via svcutil.exe. Referenced type only valid for encoded SOAP

I'm trying to generate proxy classes via svcutil.exe for a 3rd party web service using their WSDL. However, when I run svcutil.exe on the WSDL I get the following error, which then cascades down to other elements in the file causing no code to be generated. Warning 2 Custom tool warning: Cannot import wsdl:portType Detail: An excepti...

Call Method B if method A is not called for more than N seconds

I'm using following code to call Method B after N seconds method A is called. If method A is called again within the N seconds timeout, i have to reset the time counting back to N seconds. I cannot reference System.Windows.Form in my project, so I cannot use System.Windows.Form.Timer. The method B must be called in the same thread A is...

How to verify at runtime if the client WSDL matches the server WSDL?

I am developing a system where .NET (Compact Framework) clients are communicating via SOAP with a Java (AXIS2) server. As the interface is continuously evolving, I am looking for a way to check at runtime if the client interface completely matches the current interface version of the server. What is the easiest way to match the interfac...

How to create a wrapper for activex control in c# .net and embed in web page?

We have a 3rd party ActiveX control namely Autodesk's "Design Review" that we would like to use in a non aspx environment. Most functionality is available through javascript, however one key method cannot be called from that environment. Searching on the Autodesk forums we found a solution that involves creating a COM wrapper around th...

What is WCF RIA services?

I hate MSDN's site for WCF RIA services. I does not say what it is, it only says what it does. It says what it can achieve but does not say why I need it. For example: "A common problem when developing an n-tier RIA solution is coordinating application logic between the middle tier and the presentation tier". Well, it does ...

Wpf 4 DataGrid Column Binding Problem

I have created a datagrid with columns bound to an observable collection. All works well except for a column which is bound to a nullable decimal property from my business object. If I use <DataGridTextColumn Binding="{Binding Path=BaseUnitCostValue}" Header="Unit Cost Value" MinWidth="100" /> as my column definition all works well,...

is it possible to convert from byte[] to base64string and back

I tried this: Console.WriteLine(Convert.ToBase64String(Encoding.UTF8.GetBytes("hi"))); Console.WriteLine(Convert.ToBase64String(Encoding.UTF8.GetBytes(Convert.ToBase64String(Encoding.UTF8.GetBytes("hi"))))); and I get different results for them, although I thought that it should be the same ...

winforms position and dimension properties

I'm trying to untangle all the position and dimension properties of winforms, and it would be really helpful if there were a comprehensive overview explaining the relationships between them. Many of them appear to be functionally equivalent, but I'm concerned I may be making some false assumptions. For reference, I am referring to prope...

What should I write for vb.net datagridview if I want to get same result?

I have used mshflexgrid for my vb.net program. But it shows error when I try to build because vb.net doesnt support mshflexgrid. Please check my code & tell me what should I do to do same thing there in datagridview? Datagridview doesnt support same code. So would you please tell me what should I write for it? Please check my code. Publ...