.net-4.0

System.Tuple defined in multiple assemblies

烂漫一生 提交于 2020-02-03 05:29:05
问题 I just installed VS 11 within Windows 8. When I got the latest of a solution built with VS 2010, then built it, I'm getting this error (in VS 11): The predefined type 'System.Tuple' is defined in multiple assemblies in the global alias; using definition from 'c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETFramework\v4.0\mscorlib.dll' I haven't been able to find an answer via Google. And I don't know what the "global alias" is. Those words are too generic to find via a

Batch processing using IObservable

微笑、不失礼 提交于 2020-02-01 05:08:04
问题 My server side sends me batches of messages. The no of messages in a batch and frequency is arbitrary. At times I get messages at 1 minute intervals and at times not messages for an hour. At times 1 message and at times 10. My current implementation uses Observable.Buffer(TimeSpan.FromSeconds(5)) to group and send the messages to subscriber. Instead of having to check every 5 seconds, is there a way to configure the Observable to say send your buffered messages to subscriber if there's a x

“Please Wait” message using jQuery or AJAX?

对着背影说爱祢 提交于 2020-01-31 05:34:04
问题 I am creating an enterprise web template to be used for development of all our web applications. Many of our existing applications take a while to load because of the amount of data and geographic distance of the data source, so users frequently click the same buttons and links twice. I plan to add a Please Wait message to come up when the page is posting back. I figured there are two obvious ways to do this: 1. AJAX Tools Using the AJAX UpdatePanel and progress loader, I can easily show a

Difference between CLR 2.0 and CLR 4.0

断了今生、忘了曾经 提交于 2020-01-30 14:23:07
问题 I have read countless blogs, posts and StackOverflow questions about the new features of C# 4.0. Even new WPF 4.0 features have started to come out in the open. What I could not find and will like to know: What are the major changes to CLR 4.0 from a C#/WPF developer perspective? What are the major changes to CLR 4.0 as a whole? I think, internally, most changes are for the new dynamic languages and parallel programming. But are there any other major improvements? Because language

How to convert one type to another using reflection?

吃可爱长大的小学妹 提交于 2020-01-30 08:25:49
问题 I have a two types that are very similar (i.e. the member names are very similar). Is there an elegant way to copy one type to another, without having to copy each individual member by hand? Update Here is some sample source code: main() { FromCsvFile x = new FromCsvFile(fileName); OptionsEnt y = x.ToOptionsEnt(); // See helper function below. } // Chained helper function to convert type "FromCsvFile" to type "OptionsEnt". // Want to replace this with something more elegant (perhaps with

How to convert one type to another using reflection?

烈酒焚心 提交于 2020-01-30 08:25:31
问题 I have a two types that are very similar (i.e. the member names are very similar). Is there an elegant way to copy one type to another, without having to copy each individual member by hand? Update Here is some sample source code: main() { FromCsvFile x = new FromCsvFile(fileName); OptionsEnt y = x.ToOptionsEnt(); // See helper function below. } // Chained helper function to convert type "FromCsvFile" to type "OptionsEnt". // Want to replace this with something more elegant (perhaps with

How to convert one type to another using reflection?

坚强是说给别人听的谎言 提交于 2020-01-30 08:25:26
问题 I have a two types that are very similar (i.e. the member names are very similar). Is there an elegant way to copy one type to another, without having to copy each individual member by hand? Update Here is some sample source code: main() { FromCsvFile x = new FromCsvFile(fileName); OptionsEnt y = x.ToOptionsEnt(); // See helper function below. } // Chained helper function to convert type "FromCsvFile" to type "OptionsEnt". // Want to replace this with something more elegant (perhaps with

Invoking Member of a class using Class Name and Method Name

自古美人都是妖i 提交于 2020-01-29 09:49:46
问题 I am trying to invoke function of a class using Reflection (assuming that object initialization as no dependency on Function to be invoked) like this /// <summary> /// Calls a static public method. /// Assumes that the method returns a string /// </summary> /// <param name="assemblyName">name of the assembly containing the class in which the method lives.</param> /// <param name="namespaceName">namespace of the class.</param> /// <param name="typeName">name of the class in which the method

Memory Cache .Net 4.0 performance test : astonishing result

亡梦爱人 提交于 2020-01-27 20:57:31
问题 This performance test is wrong or the system cache is working with exceptional performance? This is my result : [13] number of interactions 100000 : 63 milliseconds [14] number of interactions 100000 : 139 milliseconds [12] number of interactions 100000 : 47 milliseconds [15] number of interactions 100000 : 44 milliseconds End of test. Hardware : x86 Family 6 Model 23 Stepping GenuineIntel ~2992 Mhz 3.327 MB, 5.1.2600 Service Pack 3 using System; using System.Collections.Generic; using System

Memory Cache .Net 4.0 performance test : astonishing result

我是研究僧i 提交于 2020-01-27 20:56:58
问题 This performance test is wrong or the system cache is working with exceptional performance? This is my result : [13] number of interactions 100000 : 63 milliseconds [14] number of interactions 100000 : 139 milliseconds [12] number of interactions 100000 : 47 milliseconds [15] number of interactions 100000 : 44 milliseconds End of test. Hardware : x86 Family 6 Model 23 Stepping GenuineIntel ~2992 Mhz 3.327 MB, 5.1.2600 Service Pack 3 using System; using System.Collections.Generic; using System