.net-4.0

Memory Cache .Net 4.0 performance test : astonishing result

放肆的年华 提交于 2020-01-27 20:54:06
问题 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

Convert calendar-week to Date

江枫思渺然 提交于 2020-01-24 21:39:29
问题 is there a simple builtin function that i could use to get a date instance from a calendarweek/year-combination? It should be possible to enter 10w2005 into a TextBox and i'll create the date 07 March 2005 from it. Monday should be first day and CalendarWeekRule should be FirstFullWeek. My first approach was: Dim w As Int32 = 10 Dim y As Int32 = 2005 Dim d As New Date(y, 1, 1) d = d.AddDays(7 * w) But this does not work because the FirstDay- CalendarWeekRule are not applied. Thanks in advance

Create Object and its Properties at Run-time from List

℡╲_俬逩灬. 提交于 2020-01-24 09:04:51
问题 I need to create dynamic object and its properties at run-time then create instance of this object to store values. why I want above logic! I am reading excel file in C# and first line of code is header which is actually properties and followed by each rows are record which is instance of dynamic object. List<string> ExcelDataHeader = new List<string>(); for (int y = 2; y <= colCount; y++) { ExcelDataHeader.Add(xlRange.Cells[headerRow, y].Value2.ToString()); } dynamic MyDynamic = new System

How do I create another instance of a .NET program within one instance by code?

岁酱吖の 提交于 2020-01-24 05:22:07
问题 I need to be able to create another brand new instance of a program on a button click while keeping the existing instance. this.ShowDialog(new Form1()); The above statement causes the current form to be the owner of the new form and I need the second instance to be independent of the existing instance. Can anyone help me with this? 回答1: To expound on Desolator's answer here is a simplistic example you can try a Form and a Button: public partial class Form1 : Form { public Form1() {

.NET 4.0 Breaking Change - Using a Markup Extension as Value of Property Setter in XAML Style

拜拜、爱过 提交于 2020-01-23 13:49:10
问题 In .NET 3.5SP1 I had a style with the following property setting. <Setter Property="ToolTip" Value="{resource:Resource Group=Text, Key=BTN_CLOSE}"/> The markup extension will access our satellite assemblies and pull in the proper resource text for the tooltip. The reason this is done this way is our application is customizable. Using the markup extension allows our clients to use a key combination to see the Key for the text and then go modify the text value if they choose to do so. After

.NET 4.0 Breaking Change - Using a Markup Extension as Value of Property Setter in XAML Style

女生的网名这么多〃 提交于 2020-01-23 13:47:25
问题 In .NET 3.5SP1 I had a style with the following property setting. <Setter Property="ToolTip" Value="{resource:Resource Group=Text, Key=BTN_CLOSE}"/> The markup extension will access our satellite assemblies and pull in the proper resource text for the tooltip. The reason this is done this way is our application is customizable. Using the markup extension allows our clients to use a key combination to see the Key for the text and then go modify the text value if they choose to do so. After

.NET 4.0 Breaking Change - Using a Markup Extension as Value of Property Setter in XAML Style

放肆的年华 提交于 2020-01-23 13:45:50
问题 In .NET 3.5SP1 I had a style with the following property setting. <Setter Property="ToolTip" Value="{resource:Resource Group=Text, Key=BTN_CLOSE}"/> The markup extension will access our satellite assemblies and pull in the proper resource text for the tooltip. The reason this is done this way is our application is customizable. Using the markup extension allows our clients to use a key combination to see the Key for the text and then go modify the text value if they choose to do so. After

How do I make a WiX 3.5 installer with a completely self-contained .NET 4.0 installer?

一曲冷凌霜 提交于 2020-01-22 14:36:04
问题 Continuing a previous question I asked here, I now need to move to vs2010. I've gotten the most recent weekly build of WiX 3.5, the June 5th 2010 version. Here's the relevant lines from my installer: <ItemGroup> <BootstrapperFile Include="Microsoft.Net.Framework.4.0"> <ProductName>.NET Framework 4.0</ProductName> </BootstrapperFile> <BootstrapperFile Include="Microsoft.Windows.Installer.4.5"> <ProductName>Windows Installer 4.5</ProductName> </BootstrapperFile> </ItemGroup> and

How to see .net library source code with ReSharper 5 and visual studio 2010?

倾然丶 夕夏残阳落幕 提交于 2020-01-22 14:02:41
问题 I used to see any .net source code (like System.String) with ReSharper and Visual Studio 2008. since I migrated to Visual studio 2010, this option doesn't give the full source code but just the definitions of the class. How can I fix this, to use the microsoft's symbols server again? Edit : Maybe the problem is only with .net-4.0 assemblies. is microsoft released symbols to to .net-4.0 assemblies also? 回答1: Microsoft released sources for .NET 4 release, so R# have to work just fine. Some

C# syntax - Colon after a variable name

南笙酒味 提交于 2020-01-22 08:17:59
问题 Quick question; I've recently upgraded to VS2010, and got the new version of ReSharper. Now, when ReSharper is giving me autocomplete options for a variable, it give me the option of < variableName >: What does the : stand for? For example; I have this: var productIds = new List<int>(inventoryItemsToProcess.Keys); And when I start typing out a line like this: var lastOrderDates = GetProductLastOrderDates(pro It gives me the option for productIds as well as productIds: What's the difference