Category "c++sharp"

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 ?

C# - Fetching property value from child class

I access property value from a class object at run-time using reflection in C#. public bool GetValue(string fieldName, out object fieldValue) {

How to exclude a .NET 6 Minimal API from code coverage?

I maintain a class library which contains several reference implementations to demonstrate how the library should be used. I have reference implementations for

Verifying ArgumentException and its message in Nunit , C#

In my test program in Nunit, I want to verify that it's getting the write Argument Exception by verifying the message. [Test] public void ArgumentsWork

How to call an extension method without using

using System; class Runner { static void Main() { A a = new A(); // how to say a.PrintStuff() without a 'using' Console.Read();

Writing and reading using socket

This is my code using UnityEngine; using System.Collections; using System; using System.IO; using System.Net.Sockets; public class s_TCP : MonoBehaviour { in

MongoDB Driver Builders<dynamic> dont work on equal to date

I am unable to get the result I wanted when I try to get Date equal to. FilterDefinition<dynamic> searchFilter = FilterDefinition<dynamic>.Empty; st

MongoDB Driver Builders<dynamic> dont work on equal to date

I am unable to get the result I wanted when I try to get Date equal to. FilterDefinition<dynamic> searchFilter = FilterDefinition<dynamic>.Empty; st

How to round up value C# to the nearest integer?

I want to round up double to int. Eg, double a=0.4, b=0.5; I want to change them both to integer. so that int aa=0, bb=1; aa is from a and bb is from b