c# Programming Glossary: below
How can a Word document be created in C#? [closed] http://stackoverflow.com/questions/10412/how-can-a-word-document-be-created-in-c Automation or using the Office Open XML format see links below which is supported by Microsoft Office 2000 and up either natively..
Create Excel (.XLS and .XLSX) file from C# [closed] http://stackoverflow.com/questions/151005/create-excel-xls-and-xlsx-file-from-c-sharp and documented as well. Also as noted by @ мЦа ионов below EPPlus has support for Pivot Tables and ExcelLibrary may have..
Which .NET Dependency Injection frameworks are worth looking into? [closed] http://stackoverflow.com/questions/21288/which-net-dependency-injection-frameworks-are-worth-looking-into and a registry my pain barrier in using IoC has dropped below zero I get an absolute kick out of knowing now that my IoC config..
How to create a simple proxy in C#? http://stackoverflow.com/questions/226784/how-to-create-a-simple-proxy-in-c small project Update This is what I understand see graphic below . Step 1 I configure the client browser for all request to be..
C# Captured Variable In Loop http://stackoverflow.com/questions/271440/c-sharp-captured-variable-in-loop Loop I met a interesting issue about C#. I have code like below List Func int actions new List Func int int variable 0 while..
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 properties it is common to combine them using code like below to reduce diagonal collisions i.e. so that new Foo 3 5 has a..
Dynamic LINQ OrderBy on IEnumerable<T> http://stackoverflow.com/questions/41244/dynamic-linq-orderby-on-ienumerablet without the dynamic LINQ library you just need the code as below. This covers most common scenarios including nested properties... some wrapper methods that go via AsQueryable but the code below is the core Expression logic needed. public static IOrderedQueryable..
Casting vs using the 'as' keyword in the CLR http://stackoverflow.com/questions/496096/casting-vs-using-the-as-keyword-in-the-clr as as and null check with modern JITs as shown by the code below using System using System.Diagnostics using System.Linq class..
Creating a blocking Queue<T> in .NET? http://stackoverflow.com/questions/530211/creating-a-blocking-queuet-in-net add until an item is removed from the queue. The solution below is what I am using right now and my question is How can this..
The entity cannot be constructed in a LINQ to Entities query http://stackoverflow.com/questions/5325797/the-entity-cannot-be-constructed-in-a-linq-to-entities-query categoryID select new Product Name p.Name The code below throws the following error The entity or complex type Shop.Product..
LINQ to SQL: Return anonymous type? http://stackoverflow.com/questions/534690/linq-to-sql-return-anonymous-type to SQL Return anonymous type Using the simple example below what is the best way to return results from multiple tables..
Sending email through Gmail SMTP server with C# http://stackoverflow.com/questions/704636/sending-email-through-gmail-smtp-server-with-c-sharp change on the Gmail side as you were worried about . The below code works just like the samples you referred to using System..
Anyone know a good workaround for the lack of an enum generic constraint? http://stackoverflow.com/questions/7244/anyone-know-a-good-workaround-for-the-lack-of-an-enum-generic-constraint about enum constraints . I've included the basic facts below for the sake of a standalone answer. The best solution is to..
Random number generator only generating one random number http://stackoverflow.com/questions/767999/random-number-generator-only-generating-one-random-number is what I want . However if I put a breakpoint two lines below that code all members of the mac array have equal value. Why..
Create Generic method constraining T to an Enum http://stackoverflow.com/questions/79126/create-generic-method-constraining-t-to-an-enum ugly boxing requirement to your code. EDIT All suggestions below have been greatly appreciated thanks. Have settled on I've left..
C# Finalize/Dispose pattern http://stackoverflow.com/questions/898828/c-sharp-finalize-dispose-pattern And I am still confused about some issues. My questions below I know that you only need a finalizer if you are disposing of.. myClass Do stuff here I have developed this simple code below to demonstrate the Finalize dispose pattern public class NoGateway..
How to remove all event handlers from a control http://stackoverflow.com/questions/91778/how-to-remove-all-event-handlers-from-a-control I found a solution on the MSDN forums . The sample code below will remove all Click events from button1 . public partial class..
C# Login to Website via program http://stackoverflow.com/questions/930807/c-sharp-login-to-website-via-program pageSource sr.ReadToEnd Place this directly below cookieHeader resp.Headers Set cookie and then inspect the string..
How To Accept a File POST - ASP.Net MVC 4 WebAPI http://stackoverflow.com/questions/10320232/how-to-accept-a-file-post-asp-net-mvc-4-webapi client applications. Is this possible using the webapi Below is how action I am currently using. Does anyone know of an example..
Multiple Aggregates / Repositories in one Transaction http://stackoverflow.com/questions/11445657/multiple-aggregates-repositories-in-one-transaction modifying both the payment order gift coupon aggregate. Below is what I quickly came up with as a possible way of modelling..
File.Copy vs. Manual FileStream.Write For Copying File http://stackoverflow.com/questions/1246899/file-copy-vs-manual-filestream-write-for-copying-file Stream but we are seeing a massive performance decrease. Below is some code for copying a file to use as a discussion point...
General purpose FromEvent method http://stackoverflow.com/questions/12865848/general-purpose-fromevent-method I have no idea how to access the tcs instance that I have. Below is the progress that I've made towards finishing this public..
OpenID: Trying to Get Email Address from Google OP http://stackoverflow.com/questions/1301200/openid-trying-to-get-email-address-from-google-op Log API group and was told to use Attribute exchange . Below is the code for DotNetOpenAuth . Please don't use this code..
Enum type constraints in C# [duplicate] http://stackoverflow.com/questions/1331739/enum-type-constraints-in-c-sharp madness but I'd like to understand why it's not possible. Below is what I would like to be able to do in theory . public static..
Randomize a List<T> in C# http://stackoverflow.com/questions/273313/randomize-a-listt-in-c-sharp trouble if the method is going to be called repeatedly. Below is a fixed full example based on a really useful comment received..
Split string containing command-line parameters into string[] in C# http://stackoverflow.com/questions/298830/split-string-containing-command-line-parameters-into-string-in-c-sharp Command Line String to Args using CommandLineToArgvW API . Below is a slightly simpler version of the same code DllImport shell32.dll..
Why does C# XmlDocument.LoadXml(string) fail when an XML header is included? http://stackoverflow.com/questions/310669/why-does-c-sharp-xmldocument-loadxmlstring-fail-when-an-xml-header-is-included in UTF 8 and use one of the XmlDocument.Load methods . Below is sample code demonstrating how to use a MemoryStream to build..
How do you test your Request.QueryString[] variables? http://stackoverflow.com/questions/349742/how-do-you-test-your-request-querystring-variables request.querystring share improve this question Below is an extension method that will allow you to write code like..
Get last 10 lines of very large text file > 10GB c# http://stackoverflow.com/questions/398378/get-last-10-lines-of-very-large-text-file-10gb-c-sharp where the number of lines in the file is less than ten. Below is an implementation in C# as you tagged this generalized to..
WCF Service Client: The content type text/html; charset=utf-8 of the response message does not match the content type of the binding http://stackoverflow.com/questions/5243929/wcf-service-client-the-content-type-text-html-charset-utf-8-of-the-response-me is able to call methods fine without getting this error. Below are excerpts from my config files. WCF Service Web.Config system.serviceModel..
Collection was modified; enumeration operation may not execute http://stackoverflow.com/questions/604831/collection-was-modified-enumeration-operation-may-not-execute when the debugger is attached it does not seem to occur. Below is the code. This is a WCF server in a Windows service. The..
how can i get text formatting with iTextSharp http://stackoverflow.com/questions/6882098/how-can-i-get-text-formatting-with-itextsharp etc. Is there any way to get that formatting as well. Below is the code segment i am using to exact text PdfReader reader.. I think it has to do with when you embed font subsets. Below is a complete WinForms application that targets iTextSharp 5.1.1.0..
Compression/Decompression string with C# http://stackoverflow.com/questions/7343465/compression-decompression-string-with-c-sharp and return my string its returning only half of the XML. Below is my code please correct me where I am wrong. Code class Program..
Serializing private member data http://stackoverflow.com/questions/802711/serializing-private-member-data and I have implemented the ISerializable interface. Below is the code I'm using to serialize my object. public void SaveMyObject..
using ITextSharp to extract and update links in an existing PDF http://stackoverflow.com/questions/8140339/using-itextsharp-to-extract-and-update-links-in-an-existing-pdf I can't actually imagine anyone using. Whew. Still reading Below is a full working VS 2010 C# WinForms app based on my post here..
Why is LINQ .Where(predicate).First() faster than .First(predicate)? http://stackoverflow.com/questions/8663897/why-is-linq-wherepredicate-first-faster-than-firstpredicate should not be faster than using First directly but it is. Below are two really simple unit tests that illustrate this. When..
Embedding one dll inside another as an embedded resource and then calling it from my code http://stackoverflow.com/questions/96732/embedding-one-dll-inside-another-as-an-embedded-resource-and-then-calling-it-fro byte array into the corresponding Assembly.Load overload. Below is how one such implementation could look like in C# AppDomain.CurrentDomain.AssemblyResolve..
|