c# Programming Glossary: have
Cross-thread operation not valid: Control accessed from a thread other than the thread it was created on http://stackoverflow.com/questions/142003/cross-thread-operation-not-valid-control-accessed-from-a-thread-other-than-the from a thread other than the thread it was created on I have a scenario. Windows Forms C# .NET There is a main form which..
Create Excel (.XLS and .XLSX) file from C# [closed] http://stackoverflow.com/questions/151005/create-excel-xls-and-xlsx-file-from-c-sharp with C# Ideally I would like open source so I don't have to add any third party dependencies to my code and I would like.. EPPlus has support for Pivot Tables and ExcelLibrary may have some support Pivot table issue in ExcelLibrary Here are a couple..
How to properly clean up Excel interop objects http://stackoverflow.com/questions/158706/how-to-properly-clean-up-excel-interop-objects I'm using the Excel interop in C# ApplicationClass and have placed the following code in my finally clause while System.Runtime.InteropServices.Marshal.ReleaseComObject..
Randomize a List<T> in C# http://stackoverflow.com/questions/273313/randomize-a-listt-in-c-sharp Since writing this answer a couple years back many people have commented or written to me to point out the big silly flaw in..
Deserialize JSON into C# dynamic object? http://stackoverflow.com/questions/3142495/deserialize-json-into-c-sharp-dynamic-object required for deserialisation. EDIT 2 If you are happy to have a dependency upon the System.Web.Helpers assembly then as Vlad..
Why is it important to override GetHashCode when Equals method is overridden? http://stackoverflow.com/questions/371328/why-is-it-important-to-override-gethashcode-when-equals-method-is-overridden return base.GetHashCode return this.FooId.GetHashCode I have overridden the Equals method because Foo represent a row for..
WebBrowser Control in a new thread http://stackoverflow.com/questions/4269800/webbrowser-control-in-a-new-thread Control in a new thread I have a list Uri's that I want clicked To achieve this I m trying.. web browser share improve this question You have to create an STA thread that pumps a message loop. That's the..
Why are mutable structs evil? http://stackoverflow.com/questions/441309/why-are-mutable-structs-evil by value will be the same. If you want to change it you have to consciously do it by creating a new instance of the struct..
Casting vs using the 'as' keyword in the CLR http://stackoverflow.com/questions/496096/casting-vs-using-the-as-keyword-in-the-clr of the answers so far at the time of starting this answer have really explained where it's worth using which. Don't do this.. cast. That would be a pretty rare situation but I'd rather have a convention which I can use consistently. I also maintain that.. then null check gives a better separation of concerns. We have one statement which attempts a conversion and then one statement..
Use of Application.DoEvents() http://stackoverflow.com/questions/5181777/use-of-application-doevents button that causes the same loop to get started. Now you have two nested loops executing DoEvents the previous loop is suspended..
What's the difference between String and string? http://stackoverflow.com/questions/7074/whats-the-difference-between-string-and-string examples . It appears that the guidance in this area may have changed as StyleCop now enforces the use of the C# specific..
Random number generator only generating one random number http://stackoverflow.com/questions/767999/random-number-generator-only-generating-one-random-number number generator only generating one random number I have the following function Function to get random number public.. two lines below that code all members of the mac array have equal value. Why does that happen c# random share improve..
Deep cloning objects in C# http://stackoverflow.com/questions/78536/deep-cloning-objects-in-c-sharp it into a fresh object. The benefit is that you don't have to concern yourself about cloning everything when an object.. the new extension methods of C# 3.0 change the method to have the following signature public static T Clone T this T source..
What does the [Flags] Enum Attribute mean in C#? http://stackoverflow.com/questions/8447/what-does-the-flags-enum-attribute-mean-in-c does the Flags Enum Attribute mean in C# Anyone have a good explanation or example they could post Edit I changed..
HttpClient.GetAsync(…) never returns when using await/async http://stackoverflow.com/questions/10343632/httpclient-getasync-never-returns-when-using-await-async except for api test5 which never completes. Have I encountered a bug in the HttpClient class or am I misusing..
Does Parallel.ForEach limits the number of active threads? http://stackoverflow.com/questions/1114317/does-parallel-foreach-limits-the-number-of-active-threads any expensive cross thread access when it really needs to. Have a look at the PFX Team Blog for loads of information about how..
Control another application using C# http://stackoverflow.com/questions/1134993/control-another-application-using-c-sharp even possible c# winforms share improve this question Have you looked at White TestStack Sample code Application application..
iTextSharp - Sending in-memory pdf in an email attachment http://stackoverflow.com/questions/1196059/itextsharp-sending-in-memory-pdf-in-an-email-attachment c# email pdf itextsharp share improve this question Have you tried PdfWriter writer PdfWriter.GetInstance doc memoryStream..
Reading Excel Files as a Server Process http://stackoverflow.com/questions/1273116/reading-excel-files-as-a-server-process 1M records a second was out performed by cheaper FlexCel. Have decided that the help API manual is almost useless. Koogra Didn't..
How to bind to a PasswordBox in MVVM http://stackoverflow.com/questions/1483892/how-to-bind-to-a-passwordbox-in-mvvm for an over architected solution here's one 1. Create the IHavePassword interface with one method that returns the password.. with one method that returns the password clear text. 2. Have your UserControl implement a IHavePassword interface. 3. Register.. password clear text. 2. Have your UserControl implement a IHavePassword interface. 3. Register the UserControl instance with..
Creating an instance using Ninject with additional parameters in the constructor http://stackoverflow.com/questions/2227548/creating-an-instance-using-ninject-with-additional-parameters-in-the-constructor about using DI be it Ninject or whatever else is to Have as much as possible done by constructor injection so you dont..
Is it better to create a singleton to access unity container or pass it through the application? http://stackoverflow.com/questions/2386487/is-it-better-to-create-a-singleton-to-access-unity-container-or-pass-it-through just looks odd. I may just need to get over this. Have the light bulb moment on the right way to use Unity. Hoping..
Add spaces before Capital Letters http://stackoverflow.com/questions/272633/add-spaces-before-capital-letters Letters Given the string ThisStringHasNoSpacesButItDoesHaveCapitals what is the best way to add spaces before the capital.. end string would be This String Has No Spaces But It Does Have Capitals Here is my attempt with a RegEx System.Text.RegularExpressions.Regex.Replace..
How to change RGB color to HSV? http://stackoverflow.com/questions/359612/how-to-change-rgb-color-to-hsv c# colors rgb hsv share improve this question Have you considered simply using System.Drawing namespace For example..
What is the best way to dump entire objects to a log in C#? http://stackoverflow.com/questions/360277/what-is-the-best-way-to-dump-entire-objects-to-a-log-in-c the ObjectDumper code that ships with the Linq samples . Have also a look at the answer of this related question to get a..
Import and Export Excel - What is the best library? [closed] http://stackoverflow.com/questions/444522/import-and-export-excel-what-is-the-best-library can be a commercial library. What library do you recommend Have you used it for large quantities of data Are there other solutions..
Does anyone know of a good C# API for Subversion? [closed] http://stackoverflow.com/questions/481247/does-anyone-know-of-a-good-c-sharp-api-for-subversion c# .net svn sharpsvn share improve this question Have a look at SharpSVN . This is an open source binding of the Subversion..
Multi-threaded splash screen in C#? http://stackoverflow.com/questions/48916/multi-threaded-splash-screen-in-c C# in .NET 2.0 and it provides a lot of nice services. Have the main form inherit from Microsoft.VisualBasic.WindowsFormsApplicationBase..
How to print the current Stack Trace in .NET without any exception? http://stackoverflow.com/questions/531695/how-to-print-the-current-stack-trace-in-net-without-any-exception trace printstacktrace share improve this question Have a look at the System.Diagnostics namespace. Lots of goodies..
LINQ Select Distinct with Anonymous Types http://stackoverflow.com/questions/543482/linq-select-distinct-with-anonymous-types anonymous types equality share improve this question Have a read through K. Scott Allen's excellent post here And Equality..
Binding WPF ComboBox to a Custom List http://stackoverflow.com/questions/561166/binding-wpf-combobox-to-a-custom-list have a class PhoneBookEntry with a public property Name. Have you set the DataContext to your ConnectionViewModel object I..
Create Generic method constraining T to an Enum http://stackoverflow.com/questions/79126/create-generic-method-constraining-t-to-an-enum suggestions below have been greatly appreciated thanks. Have settled on I've left the loop to maintain case insensitivity..
How to convert a String to its equivalent Expression Tree? http://stackoverflow.com/questions/821365/how-to-convert-a-string-to-its-equivalent-expression-tree http msdn.microsoft.com en us library fw84t893 VS.80 .aspx Have ANTLR create a suitable AST from a provided string. Walk the..
How to get temporary folder for current user http://stackoverflow.com/questions/944483/how-to-get-temporary-folder-for-current-user a wrapper for a native call to GetTempPath .. in Kernel32. Have a look at http msdn.microsoft.com en us library aa364992 VS.85..
|