.net-3.5

Design considerations when implementing/distributing updates for application

I have already designed an applications that is nothing more than a simple WinForm with one or two classes to handle data and collection. Fairly often I find myself refactoring parts of it or adding new features to it, not huge features but small additions to its functionality. The question I have is what would be the best way to provi...

Why is this extension method not working?

I can't get to do what I want. I only want accounts for non-international representatives. But when I call ActiveAccounts(), I'm not getting null, I'm getting an enumerable, which then includes null. What am I doing wrong here? Help please. public static class AccountExt { public static IEnumerable<Account> ActiveAccounts( this Acco...

Does Order Matter in the XML Read by the DataContractSerializer?

I have the following code: [DataContract(Namespace = "")] public class User { [DataMember] public string UserName { get; set; } [DataMember] public string FullName { get; set; } } //Deserialization test public void Test() { //CASE 1. //string xml = "<User><UserName>john</UserName>" + // "<Ful...

Is it possible to pass in more than one generically typed parameter to a method?

I currently have this method header: public virtual void SetupGrid<T>() where T : class, new() { } I want to pass in another anonymous class, I guess something like this: public virtual void SetupGrid<T><T2>() where T,T2 : class, new() { } How can I do this? ...

How to include multiple XML files in a single XML file for deserialization by XmlSerializer in .NET

Hi, is it possible to use the XmlSerializer in .NET to load an XML file which includes other XML files? And how? This, in order to share XML state easily in two "parent" XML files, e.g. AB and BC in below. Example: using System; using System.IO; using System.Xml.Serialization; namespace XmlSerializerMultipleFilesTest { [Serializ...

Render winforms controls more smoothly

My winforms application is rendering very choppy. Is there a technique that can be used to either draw a form off screen, or to have it be hidden until the layout has been processed? Anything to help speed up the visual load of my forms. Thanks for any help. edit: Forms have a couple grids each, and around 20 - 30 additional control...

WinForms DataGridView - Full text display and dataSource update

Earlier today i was suggested in here to use a DataGridView to print messages that needed a individual mark as read. I followed the suggestion, and with some reading online i managed to bind it to my message list with the following results after some tweaking. Currently i have 2 issues, the first one is that i didn't find a way to re...

System.Web.Extensions 3.5.0.0 with .NET 3.0

Is it possible to use System.Web.Extensions 3.5 without upgrading to .NET 3.5? We are using .NET 3.0 and have been asked to upgrade from web extensions 1.0 to 3.5. ...

Cookies and ASP.NET driving me crazy...

I have created a simple shopping cart application. We needed something specific to our needs, long story. Anyway, I am storing the cart object in a cookie. That work fine, but I am having trouble with deleting the cart cookie from within the class. The cart object contains a collection of products (iList). Here is the code I use to del...

In which thread's context do .NET 3.5 SendAsync's and ReceiveAsync's callbacks execute?

Are SendAsync and ReceiveAsync using IO completion ports? ...

Migrating .NET 2.0 (VS2005) C# solution to .NET 3.5 (VS2008) - What problems to expect?

My team is looking into upgrading our large-ish C# solution (~30 projects, probably thousands of files) from VS 2005 to VS 2008. From your experience, what problems, if any, are likely to appear? Oh yeah, there are a few isolated components still using VS2003 that should also be upgraded to VS2008. ...

Change API Reference at runtime VB.NET 3.5

I'm writing an application for a device running Windows XP. There are 2 versions of the device and each version has its own API to communicate with the device's software. The application I'm writing needs to pull the same data from the API. My question is how to write a application that will detect at runtime which version of the device ...

What the best way to save/load Windows Forms ToolStripMenuItem

I have several checkboxes within ToolStripMenuItem within a window form. I need to setup the registry (I think this automatic when saving, correct?) I need to save the checkboxes into registry (during form.closing event) I need to load the registry and set the checkboxes when form is loaded. I would like an option to save it to...

Some Issues about Rob Conery's repository pattern !

Hi, I'm trying to apply repository pattern as Rob Conery's described on his blog under "MVC Storefront ". But i want to ask about some issues that i had before i apply this Design pattern. Rob made his own "Model" and use some ORM "LinqToSql" to mapp his database and then he used some interfaces and custom Repositories on top of these...

Getting TargetInvocationException using Command Line Parser Library

Update 2: Seems that this library is not Compact-Framework aware at all and I keep getting other exceptions - I am leaving this question as is, but I think you should not waste time on answering it. I opened another question for suggestion of other compact-framework friendly libraries. Using the Command Line Parser Library. I am usin...

Use property type in expression

I have a function which creates a different type of expression depending on the value of the variable passed in. Protected Function BuildSortPredicate(ByVal tableType As Object, ByRef expr As Expression) Dim sortExpression As Expression If tableType Is "Job" Then sortExpression = Expression.Lambda(Of Func(Of Job, String)...

Draw Line in TextBox C# (.NET 3.5)

Hi, i need a textbox with a bottom-line such like inputfields used in forms. I had looked for a functionality like single border on bottom, or something like this. But i think the only way is to draw a single line in a textbox. The following code doesn't work: private void textEdit1_Paint(object sender, System.Windows.Forms.PaintEven...

How do I get the name of parent method/class/file name inside other method call?

Hi, I will try to explain what I need. Let's say that I have a class like this: Public Class Example1 Public Sub ToBeCalled() System.Console.WriteLine( "The Method or Class or file and its line which called me is: ", ?????) End Sub End Class Then I have a second class like this: Public Cl...

Which methods in the 3.5 framework have a String.Format-like signature?

I just noticed that I can do the following, which came as a complete surprise to me: Console.WriteLine("{0}:{1}:{2}", "foo", "bar", "baz"); This works for the Write method too. What other methods have signatures supporting this, without requiring the use of String.Format? Debug.WriteLine doesn't... HttpResponse.WriteLine doesn't... ...

reading an event log

i am trying to read from the event logs on the server.. my current code is working.. but my worry is when there are thousands of entries in the events, will it take longer to load the page?? here is my working code ArrayList chromeEntries = new ArrayList(); EventLog eventLog = new EventLog("Application", "."); foreach ...