.net

Question on using Monitor.TryEnter and locking object

Consider the following function that implements non-blocking access to only the one thread. public bool TryCancelGroup() { if (Monitor.TryEnter(_locked)) { if (_locked == false) { _locked = true; try { // do something } catch (Exception ...

Visual Studio 2008 Break Point visible style

Hi, Default settings makes each line where the break point is to be highlighted. Is there an option to make this line not to be highlighted (the point in the left side of the window is enough for me) Thanks for help ...

How do I get a diagram of the dependencies between my C# projects

I have a fairly complex application which has been broken up into multiple components. Each component has a solution file which contains a bunch of projects. So I like to think of this as a component has multiple projects/dlls in it. There is also a "common" component. All the other components depend on "common". So a compile goes like t...

listview doesn't get updated after changing isSelected property

I use an ObservableCollection<customclass> with an isSelected property bound to a listview. The customclass items are added via asyncrhonous communication with a server. I register to an NotifyCollectionChanged event and there under certain conditions set the isSelected property to true. However, this doesn't update my view. Only after s...

i want to disable a tinymce textbox

i have a tinymce textbox which i want to disable and again enable on a button click through asp.net when it is disable it should be read only. ...

.NET Framework version

I have an app that was created using .net Framework 3.5. However, I now need to change this to use the 2.0 Framework, as it needs to be distributed to a Windows 2000 machine. Will simply changing the Application Target Framework on the project properties be sufficient to do this? ...

Can we inherit singleton class?

Hi, Can we inherit singleton class? ...

How the StringBuilder class is implemented? Does it internally create new string objects each time we append?

How the StringBuilder class is implemented? Does it internally create new string objects each time we append? ...

Pretty .Net GUI Library Like using in Yahoo Messenger

Please, advise me any .net gui controls library for create user interface like in Yahoo messenger or like Trillian. May be this will be easy skin-based interface library or other. I need only simple controls ex. buttons, listview combobox, checkbox and other therefore library must be small. I know DevExpress and Infragistics libraries bu...

DataAnnotations or Application Validation block

Whats the difference between DataAnnotations and Application Validation Block? ...

.net DrawString / StringFormat problem

Hi, I'm developing a .net 3.5 Win Forms program and I've run into an "interesting" problem with text drawing. I'm implementing a text editing control and it draws text with DrawString() and StringFormat.GenericTypographic (henceforth, GT). As the user types, whole words (or groups of words) earlier in the line are moving subtly left an...

LINQ to SQL DAL, is this thread safe?

My code is written with C# and the data layer is using LINQ to SQL that fill/load detached object classes. I have recently changed the code to work with multi threads and i'm pretty sure my DAL isn't thread safe. Can you tell me if PopCall() and Count() are thread safe and if not how do i fix them? public class DAL { //read one Ca...

Differences between ExpandoObject, DynamicObject and dynamic

What are the differences between System.Dynamic.ExpandoObject, System.Dynamic.DynamicObject and dynamic? In which situations do you use these types? ...

.NET TypeBuilder - VerificationException: Operation could destabilize the runtime.

I need to create a type at runtime using the TypeBuilder. This type should implement a specific interface so that it is possible to treat instances of this dynamic type uniformly at the compile time. The interface should return an array of objects filled with values of specific fields in that type. Interface that is supposed to be imp...

How do I reference a 32 bit DLL in a 64 bit project?

I've got a C# 2.0 project which is set to target 'Any Cpu', however it is referencing a C++ project that's building a 32 bit dll. When I try to run my program on a 64bit machine I get the following error: System.BadImageFormatException was unhandled Message: Could not load file or assembly TreeTMHook, Version=1.0.2889.19619, ...

How to make Mysql .Net connector 6.3.3Beta to work in VS Web Express 2010?

I have VS Web Express 2010 installed. I have just installed Mysql .Net connector. I have taken version 6.3.3 as it was advised in [this thread][1]. However I have no option to add a connection to Mysql in VS 2010 Express database explorer. Have anybody such a problem? [1]: · http://stackoverflow.com/questions/901049/how-do-i-connec...

Simple client identification in WCF

I'm using a self-hosted WCF service with duplex tcp binding without any kind of security. I'd like to transport a username and password from the client so the server code can check for validity. How do I do that? The main goal is to keep it simple. My idea was to set the binding.ClientCredentials property when establishing the connectio...

How do I set a breakpoint on every access to a class

When working with third party systems, especially very configurable systems that dynamically load providers, controllers, components and so on, I sometimes just want to know when a certain object or class is accessed. Normally, I'd place a breakpoint on any potential lines in my source (a nuisance, but it works), but if source is not ava...

Can you tell the differences between <%= %>, <%# %> and <%$ %> asp.net expressions?

Hi, Can you briefly list the differences between <%= %>, <%# %> and <%$ %> by giving a simple example maybe that requires only one of those expressions to be used? Thanks ...

String Splitter in .NET

I have the below string P,MV,A1ZWR,MAV#(X,,), PV,MOV#(X,12,33),LO I need the output as P MV A1ZWR MAV#(X,,) PV MOV#(X,12,33) LO As can be make out that it can be easily done by splitting by "," but the problem comes when it is MAV#(X,,) or MOV#(X,12,33) type. Please help ...