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...
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...
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...
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?
...
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...
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...
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...
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.
...
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...
Are SendAsync and ReceiveAsync using IO completion ports?
...
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.
...
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 ...
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...
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...
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...
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)...
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...
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...
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...
...
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 ...