.net-4.5

XNA alternative [duplicate]

落爺英雄遲暮 提交于 2019-12-12 09:45:04
问题 This question already has answers here : Alternative to Microsoft XNA Game Studio? [closed] (2 answers) Closed 6 years ago . I recently switched to VS2012, managed to get XNA4 project working, but then I was wondering if VS2012 no longer supports (so really) and XNA seems to be such abandoned stuff, if there is an alternative to use, that is like: vs2012 compatible, and net4.5, c# not too high level (or well written and optimized) easy to learn after XNA free Priorities are from above. 回答1: I

WPF Tree view, how to change indention

谁说我不能喝 提交于 2019-12-12 09:36:42
问题 My Treeview basically has "folder" nodes, and one level below items which do NOT contain other items. Therefor the space for the expand / collapse icons is not required (on level 2). Can I give up this icon space and hence reduce the indention. The items (in the example "airports") shall be shifted some pixels to the left. Important: Basically looking for the code solution (C#), not the XAML version. 回答1: Really what you want to do is edit the HierarchicalDataTemplate and change the way it

Working with “very very” large arrays

删除回忆录丶 提交于 2019-12-12 08:56:38
问题 I need to work with very large arrays of small types (int or float arrays), i'm targeting X64 only on machines with a lot of ram, physical memory is never the issue in my scenarios. While looking at the doc for gcAllowVeryLargeObjects i noticed this point : •The maximum index in any single dimension is 2,147,483,591 (0x7FFFFFC7) for byte arrays and arrays of single-byte structures, and 2,146,435,071 (0X7FEFFFFF) for other types. Now my issue is i actually "need" to work with larger arrays

Styling a WPF Button with Image+Text

此生再无相见时 提交于 2019-12-12 08:29:55
问题 In my C#/WPF/.NET 4.5 application I have buttons with images that I implemented in the following fashion: <Button Style="{StaticResource BigButton}"> <StackPanel> <Image Source="Images/Buttons/bt_big_save.png" /> <TextBlock>save</TextBlock> </StackPanel> </Button> I have a resource dictionary UIStyles.xaml in which I declare the following: <Style TargetType="Button" x:Key="BigButton"> <Setter Property="Cursor" Value="Hand" /> <Setter Property="Height" Value="80" /> <Setter Property="Width"

.net 4.5 ASP.Net web API JSONP support

做~自己de王妃 提交于 2019-12-12 08:28:06
问题 Does anyone know if returning JSONP is supported out of the box in .net 4.5 ASP.NET WEB API? I've found plenty of "roll your own" for earlier versions of MVC or .net but there doesn't seem to be anything specific to later versions. I realize this could be because they earlier versions will work with .net 4.5 stack but I'm curious if someone has already been baked in. 回答1: As far as I know you must get the jsonp formatter. Here is one of the implementations: http://nuget.org/packages/WebApi

Task not garbage collected

主宰稳场 提交于 2019-12-12 08:26:56
问题 In the following program, I'd expect the task to get GC'd, but it doesn't. I've used a memory profiler which showed that the CancellationTokenSource holds a reference to it even though the task is clearly in a final state. If I remove TaskContinuationOptions.OnlyOnRanToCompletion , everything works as expected. Why does it happen and what can I do to prevent it? static void Main() { var cts = new CancellationTokenSource(); var weakTask = Start(cts); GC.Collect(); GC.WaitForPendingFinalizers()

How to keep .Net 4.0 behavior if .Net 4.5 is installed?

僤鯓⒐⒋嵵緔 提交于 2019-12-12 08:19:54
问题 We have a Windows Form application that targets .Net Framework 4.0. After installing .Net Framework 4.5, the application starts crashing. We'll have to investigate the crashes and we'll most probably have to fix things on our side. But is there a setting we can turn on to keep the old behavior until we are ready to use .Net 4.5? Update 07/12/2012: We found the breaking change that causes our application to crash: Given a System.Threading.Timer, when calling Dispose(WaitHandle) with an handle

Build error “Are you missing a using directive or assembly reference” - target framework version 4

浪尽此生 提交于 2019-12-12 06:49:49
问题 I've got a project that uses a library (from nuget) The target framework for my project is currently 4.0 I'm using objects and methods from the library, I get intellisense etc... However, when I build, compilation fails with The type or namespace could not be found. Are you missing a using directive or assembly reference? If I change the target framework of the project to 4.5, it compiles. Is there a way round this? EDIT As a specific example, here are the steps to reproduce this problem in

Create ziparchive native c# out of memory memorystream

三世轮回 提交于 2019-12-12 06:23:37
问题 I am using the build in feature to make a zip system.io.compression.ziparchive https://msdn.microsoft.com/en-us/library/system.io.compression.ziparchive.getentry%28v=vs.110%29.aspx and got: An exception of type 'System.OutOfMemoryException' occurred in mscorlib.dll but was not handled in user code I have read this: ZipArchive creates invalid ZIP file and this is some of my code in an *.ashx file (webforms): Dictionary<string, string> csvs = new Dictionary<string, string>(); using (var

Input mask MVC unmask in controller

杀马特。学长 韩版系。学妹 提交于 2019-12-12 05:27:31
问题 Im working in MVC 5.2 .NET 4.5 : Can anyone point me to a js or other library / method for an input mask that will unmask and just send the entered data in the view model to the controller? Any .js library I've tried so far that can unmask, still sends the mask to the controller. Thank you. 回答1: https://github.com/RobinHerbots/jquery.inputmask Set autoUnmask to true for client side validation and removeMaskOnSubmit to true to get the input with the literals removed in the server side