.net

How to display objects with dynamic fields in wpf data grid?

Hi! I want to display and edit some objects in a WPF data grid and I'm looking for a good way to do so. All objects I want to display have the same fields, but every execution the fields of my objects can differ. Here is a piece of the interface to illustrate what I mean: public interface IMyObject { IEnumerable<string> GetFieldNam...

How to manage .NET Master Pages in Dreamweaver CS4 ?

Has anybody figured out how to make .aspx pages render the Master Page visuals in Dreamweaver design mode? ...

How do I add two lists in Linq so addedList[x] = listOne[x] + listTwo[x]?

I want to add two lists of a numeric type such that addedList[x] = listOne[x] + listTwo[x] The output of the list needs to be a Generic.IEnumerable that I can use in future linq queries. While I was able to do it using the code below, I can't help but feel like there must be a better way. Any ideas? List<int> firstList = new List<in...

PropertyGrid PaintValue problem: How to remove (and paint outside) the standard rectangle?

This might be a straightforward question, even though I haven't found an easy solution to it: I've implemented my custom UITypeEditor with the sole purpose of adding a PaintValue to bools. For the sake of the discussion, let's assume that PaintValue will either paint a checked or unchecked radiobutton. Question 1: Now, here's the prob...

Do you gain any operations when you constrain a generic type using where T : struct?

This may be a bit of an abstract question, so apologies in advance. I am looking into generics in .NET, and was wondering about the where T : struct constraint. I understand that this allows you to restrict the type used to be a value type. My question is, without any type constraint, you can do a limited number of operations on T. D...

Divide and conquer of large objects for GC performance

At my work we're discussing different approaches to cleaning up a large amount of managed ~50-100MB memory.There are two approaches on the table (read: two senior devs can't agree) and not having the experience the rest of the team is unsure of what approach is more desirable, performance or maintainability. The data being collected is ...

Define global textbox (or other control) width in WPF

I'd like to be able to maintain the width of controls globally throughout my WPF application. Previously in winforms world I'd override onload in a base form and iterate through all controls and containers and determine the type of controls and set the dimensions accordingly. I guess I could do the same in WPF but is there any better w...

Sync Vs. Async Sockets Performance in .NET

Everything that I read about sockets in .NET says that the asynchronous pattern gives better performance (especially with the new SocketAsyncEventArgs which saves on the allocation). I think this makes sense if we're talking about a server with many client connections where its not possible to allocate one thread per connection. Then I...

Is there a performance disadvantage for WPF''s Control properties?

I am learning WPF and it seems like some properties like Content are of type Object. When you have a very complex UI with 1000s of controls, would this be a problem with boxing, etc? I see that this provides a lot of power (having Content to take anything), but just thought I should ask people's opinions about this. ...

.NET 3.5 DataGridView Control Display values

Hi, Having a problem with the dataGridView control being populated with Display members: Code: private string settingsFile = @"Data\IntelliSched.xml"; private void loadDataFromXML() { dataSetXML.ReadXml(settingsFile); } DataSet contents: Table -> zone id name ---- Table -> postcode name code zone active ---- Pic...

need thoughts on my interview question - .net, c#

One of the questions I was asked was that I have a database table with following columns pid - unique identifier orderid - varchar(20) documentid - int documentpath - varchar(250) currentLocation - varchar(250) newlocation - varchar(250) status - varchar(15) I have to write a c# app to move the files from currentlocation to newlocati...

LINQ to group objects according to timestamp

I have a serial of object defined as: public class Foo { public DateTime Time {get;set;} } now I want to group objects(IEnumerable<Foo>) according to the time, e.g. I want to group them according to hour or day or month. for example (group into hour): group 1(13:00-14:00) : foo1, foo2, foo3 group 2(14:00-15:00): foo4, foo...

Regular expression .Net replace single characters followed by spaces at the beginning of string

I need to replace "x y z word1 word2" with "x_y_z word1 word2" The number of single characters may vary. ...

How to read a textfile using C#.Net

Hi, I have a text file. I want read that file. But In that if the line starts with 6 then i want read that file otherwise leave that line and go to next line. If the line starts with 6 then i want to read that line from position 6 to 15 and 45 to 62. I want to implement this code in C#.NET. How to write that code? Can anyone Help me. ...

FTP download directory c++

How can i download all directory from server recursively. I use WinINet and this problem solve very hard. I interested there is some easy way that download files and folders from ftp on visual-c++? ...

how to show a windows folder contents in a windows form using .NET?

i want to show the folder contents in my windows form from where user can copy paste the files user needed, what type of container i have to use for this purpose? ...

how can I future-proof migration of a ADO.net local data layer to a future web based interface (web-service or REST)?

Hi, BACKGROUND: I am working on a .NET WinForms application now (C#) with an ADO.net database for the data layer. QUESTION: How an I develop this now such that it would be easy to migrate to a model where the data layer is abstracted via a HTTP web-service or REST interface? For example would just use of a standard C# interface with...

How to create webparts like this one

I want to create a webpart programmatically like below to contain fixed links to some internal pages: The two shown in red blocks. How to create these webparts and attach to the site programmatically? ...

how to add folder to a listbox in .net?

i have a list box and i want to add a folder/directory to that which is at the specified location i have used the code string path = "E:\\shruti\\MyDir"; DirectoryItem folder = new DirectoryItem(path); lstBurnItems.Items.Add(folder); //add folder to listbox but its not working fine... what should i do to get success?? ...

progress bar is not showing progress results??

i have used progress bar in my application..my application is working fine but the progress bar is blank..it does not show the working progress what is wrong?? ...