Category "c++sharp"

Changing the default icon in a Windows Forms application

I need to change the icon in the application I am working on. But simply browsing for other icons from the project property tab -> Application -> Icon, it

How to queue a completion port action (I/O bound function) to CLR ThreadPool

I have an external library that does long running I/O. I wish to create a multithreaded application that will use ThreadPool to limit simultaneous number of thr

Getting Elapsed Time with DispatchTimer to 1 millisecond accuracy

I'm trying to measure the elapsed time in milliseconds between keypress events using a dispatch timer but when declaring a dispatch timer to have an interval of

Performance cost of 'new' in C#?

In C# what is the performance cost of using the new keyword? I ask specifically in relation to games development, I know in C++ it is a definite no-no to be new

Using GetHashCode to test equality in Equals override

Is it ok to call GetHashCode as a method to test equality from inside the Equals override? For example, is this code acceptable? public class Class1 { pub

.NET OutOfMemoryException

Why does this: class OutOfMemoryTest02 { static void Main() { string value = new string('a', int.MaxValue); } } Throw the exception; but

EntityDataSource - how to do WHERE Clause from different table

Hi I am using EF 4 and EntityDataSource in a Page (WebForms). This page contains a DropDownList that display UserName. Data from this DropDownList it is from "

Moq Expression with Constraint ... It.Is<Expression<Func<T, bool>>>

Ok, I am having a hard time trying to figure out how to setup a moq for a method that takes in an expression. There are a lot of examples out there of how to to

Opening a PDF file from within a WPF application

I have a WPF application in which the GUI displays a few different aspects of the application to the user, using a different tab for each part of the applicatio

How to check if all values of a C# dictionary are true?

I have a dictionary in C# with var customDictionary = new Dictionary<string, bool>(); How can I check if all the values in a dictionary are true and retu

What might cause a performance drop after migrating a WPF project from 3.5 to 4.0?

When I compile my application to target version 4.0 of the framework, UI performance goes straight to hell. For instance, opening an Expander that contains a G

How do you code a throbber ("loading" or "waiting" graphic) in WPF?

How do you code that "loading" or "waiting" graphic in WPF? If someone had a page that requires loading a lot information, typically on a flash web site, you s

How to invoke a method with (Outlook.Application application) as parameter in C#?

I am trying to use this solution in which method DisplayAccountInformation() is being called. public partial class OutlookContacts : Form { public Outlook

The new Input System doesn't trigger anything anymore

This post is shamelessly a copy/paste from my post on the Unity Forums : https://forum.unity.com/threads/input-system-doesnt-trigger-anything-anymore.717386/, b

Unit Testing WeakReference

It seems the following code to unit test WeakReference does not work correctly/reliably: object realObject = new object(); WeakReference weakReference = new Wea

How to convert XML columns to rows in SQL database?

I am trying to import an XML invoice to SQL database. After some research, I have managed to put it in SQL database but it has x rows whereas it should be a sin

Make first letter of a string upper case (with maximum performance)

I have a DetailsView with a TextBox and I want the input data be saved always with the first letter in capital. Example: "red" --> "Red" "red house" --> "

Unable to connect to any of the specified mysql hosts. C# MySQL

I am getting the above error when I execute the code - MySqlConnection mysqlConn=new MySqlConnection("server=127.0.0.1;uid=pankaj;port=3306;pwd=master;database

The call between InitializeComponent(); is ambiguous?

My error is: Error 4 The call is ambiguous between the following methods or properties: 'Grub2._0.Time.InitializeComponent()' and 'Grub2._0.Time.Initia

send HTTP POST request in .net

How can I make an HTTP POST request and send data in the body ?