.net

How to set amcap's default color space to YUY2?

Hi, AMcap is a app for capturing video or to preview from webcam. Its source code comes with Microsoft Windows SDK as sample. I want to (bypass the following process of user interaction in amcap code or say want to) set it as default: Ampcap menu Options Video Capture Pin ... Color Space/Compression: YUY2 Out...

Problems working with decimal type in .NET

Hi all, I'm having a bit of a curious problem with .NET and working with the decimal type. My web application uses the following globalization settings: <globalization culture="auto" enableClientBasedCulture="true"/> With that in mind, consider the following: the decimal value 123.00 becomes £123.00 in GBP, and EUR 123,00 (note the c...

Large File (30Mb+) Uploads over the Internet, what are the better options?

A friend and I have been discussing what's the best way to send large file over the Internet. FTP, single Web services, Chunking Bytes To multiple Web Services, HTTP File Post (multi-part message), RIA Interface (SilverLight or Flash). Are there answers/solutions that are missing? Let me give you more of my specific situation. I ...

Convert EPS/PDF to JPEG/PNG?

Hi I need to be able to take EPS and PDF's and convert them to JPEG/PNG on the fly to display on a website - using .net code. I used ADC PDF from WebSupergoo for this like 3 years ago, and it worked fine - but some other and better options could easily have surfaced since then. ...

C#: Which uses more memory overhead? A string or a char holding a sequence of a word?

C#: Which uses more memory overhead? A string or a char holding a sequence of a word? I know a char is basically an array of each char to make up a word (if more than one char), but which would ultimately cause you more memory overhead like when using a string vs. a char to hold something the length of a word? ...

Putting a scoll bar on a wrap panel contained within an items control

Hi, Does anybody know how I can add a scroll bar to a wrappanel contained within an itemscontrol? ...

Visual studio 2010 and C# v.4

Hello, A few days ago VS 2010 went in Beta test and usually with new Visual Studio ,we get new C#. Since VS and .NET 4 is in Beta does that mean that C# version four is near to the finish? Edit: is C# v4 Beta included in the VS 2010 beta? ...

AOP Dirty Tracking

In the past I have used a few different methods for doing dirty checking on my entities. I have been entertaining the idea of using AOP to accomplish this on a new a project. This would require me to add an attribute on every proptery in my classes where I want to invoke the dirty flag logic when the property is set. If I have to add an ...

.NET or Java based small desktop app

Hi, I am trying to get a very small desktop app built - something that can be downloaded by people very quickly. I am trying to decide whether i shd build it in .net or java. I know Java will be cross platform, but I want to know if a lot of Windows users do not have JRE installed on their computers, in which case I am told they will ne...

How do I open an already opened file with a .net StreamReader?

I have some .csv files which I'm using as part of a test bench. I can open them and read them without any problems unless I've already got the file open in Excel in which case I get an IOException: System.IO.IOException : The process cannot access the file 'TestData.csv' because it is being used by another process. This is a snippe...

WCF naming conventions for extending methods.

I have a method exposed as an OperationContract for my WCF service that i would like to rework. The previous programmer had written something like: public ReportResultObject GetReport(string stringContainingParameters) I would like to have a method that is something more like this: public ReportResultObject GetReport(int[] someIds, ...

TreeView bug in windowsforms when using OwnerDrawAll

When clicking on a node in a TeeView using OwnerDrawAll it does not get selected until it receives a mouse up which is a different behavior from the standard mode and obviously not correct. Does anyone have a solution to this? Run the code below to see this behaviour: public partial class Form1 : Form { private System.Windows.Forms...

Appropriate use of custom attributes?

I have a DataContract class that I have to fill by values from the Active Directory of our company. [DataContract(Namespace = Global.Namespace)] public class UserProfile { [DataMember(IsRequired = true, EmitDefaultValue = false)] public string EmployeeID { get; private set; } [DataMember(IsRequired = true, EmitDefaultValue ...

How do I draw onto Control borders?

Hi, I have a bunch of controls laid out and I want to be able to drag an image over and around the controls. My problem is that the image is broken up by the borders of the controls. My question is: How do I register that the control has a border, and how do I find out how much the control's ClientRectangle is affected by this. Also, ...

C#: Inheritance Problem with List<T>

Let's assume this class in C#: public class LimitedList<T> : List<T> { private int _maxitems = 500; public void Add(T value) /* Adding a new Value to the buffer */ { base.Add(value); TrimData(); /* Delete old data if lenght too long */ } private void TrimData() { int num = Math.Max(0, ba...

How to use default XML serialization from within custom XML serialization methods

I have a class in .NET that implements IXmlSerializable. I want to serialize its properties, but they may be complex types. These complex types would be compatible with XML serialization, but they don't implement IXmlSerializable themselves. From my ReadXml and WriteXml methods, how do I invoke the default read/write logic on the XmlR...

How to open a different project from current project using threads or processes in C#.?

Hi, I have developed a window application in VS2005 using C#. I need to integrate another project with my project EDIT: i.e pass a variable from 1st project to 2nd project and load the form of the 2nd project. So i called that other project's main using, namespace.className.Main(args); But if i do so, when the 2nd project is open ...

AD group name with '/' character is blowing up my binding

I get the memberOf property for my user using this code: DirectorySearcher search = new DirectorySearcher(new DirectoryEntry(connectionString)); search.Filter=string.Format("(&(sAMAccountName={0})(objectClass=user))",userName); SearchResult result = search.FirndOne(); So far so good. However I then have to get the cn value for each gr...

EntityKey and ApplyPropertyChanges()

I need to set an EntityObject's EntityKey. I know its type and its id value. I don't want to query the database unnecessarily. This works... // // POST: /Department/Edit/5 [AcceptVerbs(HttpVerbs.Post)] public ActionResult Edit(Guid id, Department Model) { Model.EntityKey = (from Department d in db.Department ...

Linq To SQL Attach/Refresh Entity Object

In Linq To Sql, when updating one of my entities, Faculty, I am creating a new instance of the Faculty object, then initializing some of the properties with values supplied by the user. If I attach this new object to the entity set, and submit changes, the properties that I didn't set take on the default value of whatever datatype they ...