.net

How to increase the size of checkbox in WinForms?

How do I increase the size of a checkbox in a .Net WinForm. I tried Height and Width but it does not increases the Box size. ...

Windows Service running as LocalSystem but needs to start a process as the currently logged on user

I'm running a windows service (written using .NET) as the user - LocalSystem. From the service, I need to start a process but as the currently logged on user. If I user Process.Start(process_name), it runs with the privilege of the service by default - that's as LocalSystem. How do I impersonate the currently logged on user and run the ...

Are there any good tutorials for using SCSF?

I am wanting to look into the Smart Client Software Factory (SCSF) as I have been advised it may provide a good solution to a project I am looking into. Can anybody point me towards any good tutorials that will introduce me to SCSF and what it is capable of. ...

What advantages does pairing .Net development with SQLServer give in terms of ORM?

In Java, Hibernate is king in terms of automating code/DB synchronization. And I'm aware NHibernate is a .NET equivalent, and that LINQ has some cool SQL functions (despite not being developed further IIRC). But, is there any advantage from pairing .Net development with a SQLServer database? Magic automatic persistence of objects perhap...

How to modify a workflow from rehosted workflow designer on runtime?

I have the rehosted workflow designer, but I want to modify a workflow of an application at runtime. How I can accomplish that? Fonts: Rehosted Workflow Designer Thanks in advance! ...

Tips on creating a C++ DLL to be used from .NET

Hey guys, I'm creating a DLL in C++ and I want it to be usable from .NET apps (both C# and VB.NET). I've been scouring the internet for tips and what I've found so far suggests: Declaring my C++ functions as extern C and using __stdcall Using basic C types for parameters and return types instead of STL containers (e.g. char* instead of...

WPF, WVVM, Databinding, and ResourceDictionaries

I've got a View (MainView) which contains a kind of main content area (MainContent). The View is backed by a corresponding ViewModel (MainViewModel). The main content changes, of course, based on the current state of the application and is represented in the ViewModel as a property (CurrentPrimaryViewModel). The content of MainContent...

About exception handling in .NET

Suppose there is a .NET application that uses lots of system events and framework methods. I find it hard to manually read the documentation of each event and method to see if they throw exceptions. Is there a VS tool or a third-party application that runs through source code and indicates which events, methods, etc. are not exception ha...

URL Routing - passing data outside of the URL

Hi, I'm using the MVC URL rewriting functionality in a standard web forms application so I can have nice-looking URLs. However I've reached a point in my application where I need to pass data between pages which would look both long & ugly if it was included in the URL. Up until this point I've been cutting up the URL behind the scenes...

How can I prevent Backspace from taking me back to the previous page while I use the login box.

the login box is in the header of the website, availalbe on all pages. I'm using a javascript : <script type="text/javascript" language="javascript"> history.forward(); Which solves the issue of the backspace in the login box. But while I'm browsing the rest of the website, I can use backspace to see the previous page, I'd ha...

Unit testing private functions in Silverlight

Does anyone know how to test private functions in a Silverlight Unit Test project? The *_Accessor objects don’t seem to be available that are their in a normal unit testing project. ...

Using IXmlSerializable interface on complex object graph

If using custom XML Serialization (IXmlSerialiable), on a complex object that contains properties with constituent complex objects which do NOT use custom IXmlSerializable interface, how do you specify, in the IXmlSerializable.ReadXml(XmlReader reader) method, that you want the deserializer to use the ordinary deserialization on those ch...

Can you recommend an good Events for Dummies link?

Can you recommend an Events for Dummies link? Using C# would be best. ...

Is there a performance difference between properties vs. backing fields in read/write operations?

When working within a class on its own fields and properties, I typically only use the property when it performs some function (like limiting a value or validating or whatever). Otherwise I prefer to read/write the backing field directly. I somehow got it in my head that this would be a more generally performant way to do things, but i...

Interoperability between System.Windows.Forms.Application and System.Windows.Application

Hello, I have to integrate a WPF UI into a .NET 2.0 application. ObservableCollection needs to be modified in the GUI Dispatcher thread, so I came up with a solution involving InvokeLater() ObservableCollection<Item> items; public delegate void AddItemDelegate(Item i); public void AddItem(Item item) { System.Windows.Application.C...

"Lenient" regex matching of similar characters in C#/.Net

Is there a way to get .Net to positively match strings, even if some characters are not exactly the same? Examples of characters that should be considered to be similar could be: 'a'/'á' and 'í'/'i'. The Chrome browser find-as-you-type recognizes these characters as being equivalent. ...

visual studio copy local

In visual studio, when you add a reference there is a flag in the properties called, "Copy Local". There is some confusion about what this actually does and when. It seems easy to understand but my question is when does it copy local. Is it when the reference is added or does it copy the dll locally when the project is built. The re...

EF InvalidOperationException More than one item in the metadata

Hi, I have a problem with saving changes in Enitity Framework. I create a new repository, which creates a new ObjectContext. I then use Films.First(u => u.film == filmId); to get the object, update some of the properties and then call repository db.SaveChanges(System.Data.Objects.SaveOptions.None); I then get the error: InvalidOperatio...

Add header for System.Net.Mail.Attachement class

I need to send email with attachement using standart .Net classes. Attachement should be auto-generated string. I use for this method Attachment.CreateAttachmentFromString(), but when I recieve this message attachcment part doesn't contain a header 'content-disposition' and on some Smtp clients (Mail.app for example) it is part of messag...

Should I use WinForms or WPF for taking pics with webcam?

We have a Logitech web cam that we want to get working with .NET. It needs to recognize the device, and be able to take a picture. We just installed VS 2008, and I was wondering if Microsoft made it easier to interact with devices with some of the newer stuff like WPF, Silverlight, or whatever. If anybody can point me in the right dir...