.net

In .Net, how do I decorate a class with an intellisense tip?

I want to be able to decorate classes and methods with the text that intellisense shows when you are instantiating the class or accessing a field. For example, I want to give usage instructions. I can't find the appropriate decoration for this. How do I do it? ...

How to determine Type dependencies at runtime

The specific scenario I am trying to solve is to copy all the data in a LINQ to SQL data context. Because of the relations I need to copy the leaf nodes of the entity dependencies first so they exist before I add the entities that reference them. Preferably I am looking for a library, alternatively an algorithm if there is a simple one....

C# 4.0, optional parameters and params do not work together

How can i create a method that has optional parameters and params together? static void Main(string[] args) { TestOptional("A",C: "D", "E");//this will not build TestOptional("A",C: "D"); //this does work , but i can only set 1 param Console.ReadLine(); } public static void TestOptional(string A, int B = 0, params string[...

Custom form shape slow to load, store Region on disk! c#

hi I'm using code from the following link and using the fast / unsafe option. however on slower pc's there is still a lag. http://www.vcskicks.com/custom_shape_form_region.php I was wondering if on first run the app creates the region and then stores it somewhere or even I supply it with the app if that would speed it up!?? if so how ...

[winforms] Open Url sending POST

How to open an webbrowser and sending POST within .net 2 something like this html function. <form action="http:www.url.com/get" method="post"> <input name="tt_2a" > <input type="submit" value="submit"> I want something lik the html function i have mentioned above, open an url, post something and see the results in the opened pag...

LINQ to DataSet, DataTable.AsEnumerable() not recognized

I am brand new to LINQ and am trying to query my DataSet with it. So I followed this example to the letter, and it does not work. I know that my DataTable needs the .AsEnumerable on the end, but it is not recognized by the IDE. What am I doing wrong? Am I missing a reference/import that is not shown in the example (wouldn't be the fi...

What are the 'Client Profile' versions of .net framework 3.5 and 4 in Visual Studio 2010?

I don't know the differences between 3.5 and 3.5 Client Profile, same for 4. So, what's up with that? ...

How to compare two datetimes

I wonder how to compare two DateTime objects in .NET using DateTime methods Compare, CompareTo or Equals without comparing ticks. I only need a tolerance level of milliseconds or seconds. How can this be done? ...

DoDragDrop() to windows 7 taskbar

I am trying to allow drag&drop from my program (winforms) to windows 7 taskbar (pin my program), without success. What am I doing wrong? DataObject objData = new DataObject(); objData.SetData(DataFormats.FileDrop, true, new string[] { Application.ExecutablePath }); ((Control)sender).DoDragDrop(objData, DragDropEffects.Link); ...

Why can't I use the WaitHandle from Socket.BeginSend to wait for the operation to complete?

Hello all. I was using the following code to send data asynchronously but I noticed that using WaitOne in the AsyncWaitHandle that I get from asyncRes doesn't wait at all. I checked MSDN and it says I should use a ManualResetEvent. ... var asyncRes = _socket.BeginSend(encodedFrame, 0, encodedFrame.Length, SocketFlags.None, sendCallback,...

What would be the best way to fetch around a million record from DB?

I need to fetch and show data on a webpage whose number of records may vary based on filters from around 500 records to 1 million records. Will caching be of any use here as I think million record in memory is not a good thought. SqldataReader? Paging is a must to implement of course. Showing 1 million records is a worst case scenario(...

What are good resources for animating and displaying 3d objects in silverlight ?

An example of such an animation would be a dice rolling .. ...

Create data objects from Xaml file

Currently I am trying to load some Xaml files to create testdata. I used the Xaml files to create data for the WPF designer in Visual Studio (DesignData). Now I want to reuse them in my Unit Tests. I need to load them somehow programmatically. Here is a small test program: // The data model class TestItem { public string Name { get...

Extract region and replace them back for a template

I have a template where I want to replace certain regions. In my example below, I want to extract the regions between the ... comments, manipulate it, then replace them back after the manipulation. I do not need the logic to merge the fields, but I need to extract the regions so I can use my logic and place it back into the template. ...

IIS error hosting WCF Data Service on shared web host

My client has a website hosted on a shared web server. I don't have access to IIS. I am trying to deploy a WCF Data Service onto his site. I am getting this error: IIS specified authentication schemes 'IntegratedWindowsAuthentication, Anonymous', but the binding only supports specification of exactly one authentication scheme. Val...

No intellisense in Visual Studio 2010 Test Projects

Is there anything special about Test Projects that would cause intellisense not to work? This is my first experience with a test project. ...

Signing data with PEM key and password in PHP. How to do same thing in .NET?

Hello everyone, I've got this code written in PHP: $text = "some data to sign"; $password = "some password"; $file = "private.pem"; $fp = fopen($file, "r"); $private = fread($fp, filesize($file)); fclose($fp); $pkeyid = openssl_get_privatekey($private, $password); openssl_sign($text, $signature, $pkeyid); $signature = base64_encode($s...

Semi-transparent PictureBox (C# Windows Forms Application)

Hey All, I have searched and searched, and could only find very, very lenghy VB articles on this. Is there any way at all, in C#, to make a picturebox semi-transparent so that you can actually see through the PictureBox and see what's behind it? Thanks Any help at all is appreciated. ...

What are the pros & cons in creating an automated build system for each project in .Net?

Having just spent a frustrating amount of time configuring an automated build with psake the thought occurred to me why not use the language I know best to create a builder? psake is an excellent framework to create an automated build. The trouble I always have is learning powershell to run more complex tasks. I'm sure the same can be s...

Is there a meaningful difference between "Double" and "double" in .Net?

As regards best practices, is there a meaningful difference between using: Double d; and double d; I know best practices are fraught with contradictions, so I know the answers may vary here. I just want to know the pragmatic difference between the two. ...