.net-4.0

WPF DataGrid horizontal scrollbar not showing

不打扰是莪最后的温柔 提交于 2020-04-05 11:52:09
问题 I have created simple DataGrid with 4 columns, which go outside the bounds of DataGrid, and horizontal scrollbar is not showing. I tried setting width to each column but nothing changed. Here is my XAML: <Window x:Class="WPFTest.Window1" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Window1" Height="300" Width="300"> <Grid> <DataGrid Height="200" Width="200" HorizontalScrollBarVisibility="Visible"> <DataGrid

Original file bytes from StreamReader, magic number detection

限于喜欢 提交于 2020-03-18 12:15:37
问题 I'm trying to differentiate between "text files" and "binary" files, as I would effectively like to ignore files with "unreadable" contents. I have a file that I believe is a GZIP archive. I'm tring to ignore this kind of file by detecting the magic numbers / file signature. If I open the file with the Hex editor plugin in Notepad++ I can see the first three hex codes are 1f 8b 08 . However if I read the file using a StreamReader , I'm not sure how to get to the original bytes.. using (var

Publish is not transforming web.config?

℡╲_俬逩灬. 提交于 2020-03-18 10:35:38
问题 I made a web.config ( full file , it doesn't show XML errors) <?xml version="1.0"?> <configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <configSections> ... <location path="." inheritInChildApplications="false"> <connectionStrings> <add name="ElmahLog" connectionString="data source=~/App_Data/Error.db" /> <add name="database" connectionString="w" providerName="System.Data.EntityClient"/> </connectionStrings> </location> ... with a transform file ( web.Staging.config )

.NET Framework 4 in WPF not showing bitmap effect

冷暖自知 提交于 2020-03-14 11:09:46
问题 I am having a problem using VS2010 and framework version 4 with bitmap effects. If I have the code below and run it in a WPF application using the .NET Framework 4 Client Profile, the bitmap effect does not appear. If I set the framework version to .NET Framework 3.5 Client Profile (and change no code), it runs as expected. At first, I thought it was a problem in my application, but I removed the code and put it in a separate standalone application and it behaves the same. Anyone else verify

How to build dependent project first with msbuild

ぃ、小莉子 提交于 2020-03-01 04:07:46
问题 I have just started looking into msbuild, because I want to make my own build scripts. For now I am able to create build scripts that compiles only one project, but how do I handle dependencies? For example what if I have two projects that gets build with these two msbuild scripts? projectA.xml projectB.xml How do I tell msbuild that when I am executing projectB.xml that it should first execute projectA.xml? I have googled alot on this, but it does not seem to get anything that a starter like

How to build dependent project first with msbuild

扶醉桌前 提交于 2020-03-01 04:06:33
问题 I have just started looking into msbuild, because I want to make my own build scripts. For now I am able to create build scripts that compiles only one project, but how do I handle dependencies? For example what if I have two projects that gets build with these two msbuild scripts? projectA.xml projectB.xml How do I tell msbuild that when I am executing projectB.xml that it should first execute projectA.xml? I have googled alot on this, but it does not seem to get anything that a starter like

Task.ContinueWith() vs 2 Tasks?

微笑、不失礼 提交于 2020-02-25 06:53:51
问题 When should I use Task task1 = Task.Factory.StartNew (() => {...}) .ContinueWith (ant => Console.Write ("2")); vs Task task1 = Task.Factory.StartNew (() => {... }); Task task2 = task1.ContinueWith (ant => Console.Write ("2")); 回答1: It means the same, except for you'll have a reference to the second task now. You can use the second option if the first task needs some processing before executing the tasks all together. An example is to add another var task3 = task1.ContinueWith() so task two

Task.ContinueWith() vs 2 Tasks?

自闭症网瘾萝莉.ら 提交于 2020-02-25 06:50:05
问题 When should I use Task task1 = Task.Factory.StartNew (() => {...}) .ContinueWith (ant => Console.Write ("2")); vs Task task1 = Task.Factory.StartNew (() => {... }); Task task2 = task1.ContinueWith (ant => Console.Write ("2")); 回答1: It means the same, except for you'll have a reference to the second task now. You can use the second option if the first task needs some processing before executing the tasks all together. An example is to add another var task3 = task1.ContinueWith() so task two

OpenXML 2.0 Gets wrong cell value

社会主义新天地 提交于 2020-02-22 07:32:46
问题 I'm having a bit of a problem reading a value from an Excel 2010 worksheet. On a standard Excel 2010 worksheet I have a cell with the currency format with two decimal places and the value 1270,14 € . When I read this value on OpenXML 2.0 (C# code) I get 1270.1400000000001 instead of the original 1270.14 . The same happens with other values on any cell with the same formating. Get value from cell OpenXML code: private string GetCellValue(string column, int row) { column = column.ToUpper(); var

OpenXML 2.0 Gets wrong cell value

佐手、 提交于 2020-02-22 07:30:12
问题 I'm having a bit of a problem reading a value from an Excel 2010 worksheet. On a standard Excel 2010 worksheet I have a cell with the currency format with two decimal places and the value 1270,14 € . When I read this value on OpenXML 2.0 (C# code) I get 1270.1400000000001 instead of the original 1270.14 . The same happens with other values on any cell with the same formating. Get value from cell OpenXML code: private string GetCellValue(string column, int row) { column = column.ToUpper(); var