¡@

Home 

c# Programming Glossary: but

How do you do a deep copy an object in .Net (C# specifically)?

http://stackoverflow.com/questions/129389/how-do-you-do-a-deep-copy-an-object-in-net-c-specifically

I want a true deep copy. In Java this was easy but how do you do it in C# c# .net serialization share improve.. question I've seen a few different approaches to this but I use a generic utility method as such public static T DeepClone..

Create Excel (.XLS and .XLSX) file from C# [closed]

http://stackoverflow.com/questions/151005/create-excel-xls-and-xlsx-file-from-c-sharp

solution is easy and is the current way I am handling this but I would like to control the output formats. EDIT I am still.. the best alternative for my solution. Interop will work but it requires Excel to be on the machine you are using. Also the.. machine you are using. Also the OLEDB method is intriguing but may not yield much more than what I can achieve with CSV files...

How do you convert Byte Array to Hexadecimal String, and vice versa?

http://stackoverflow.com/questions/311165/how-do-you-convert-byte-array-to-hexadecimal-string-and-vice-versa

This is probably a common question over the Internet but I couldn't find an answer that neatly explains how you can convert..

Dynamic LINQ OrderBy on IEnumerable<T>

http://stackoverflow.com/questions/41244/dynamic-linq-orderby-on-ienumerablet

you could add some wrapper methods that go via AsQueryable but the code below is the core Expression logic needed. public static..

Use of Application.DoEvents()

http://stackoverflow.com/questions/5181777/use-of-application-doevents

. There's been an enormous amount of backlash against it but nobody ever really explains why it is bad . The same kind of.. There's more the user could click the same menu item or button that causes the same loop to get started. Now you have two.. and the new loop is starting from scratch. That could work but boy the odds are slim. Especially when the nested loop ends..

Random number generator only generating one random number

http://stackoverflow.com/questions/767999/random-number-generator-only-generating-one-random-number

could argue we've just made the outcome even more random but what we are actually doing is potentially breaking the internal.. different Random instances per thread either can be fine but mutating a single instance from multiple callers at the same..

Deep cloning objects in C#

http://stackoverflow.com/questions/78536/deep-cloning-objects-in-c-sharp

a new object and then copying each property individually but it always leaves me with the feeling that there is a better..

Is there a way to check if a file is in use?

http://stackoverflow.com/questions/876473/is-there-a-way-to-check-if-a-file-is-in-use

repeatedly access 1 image file. Most of the time it works but if my computer's running fast it will try to access the file.. another process . I would like to find a way around this but all my Googling has only yielded creating checks by using exception.. with it. Understand your hesitation about using exceptions but you can't avoid them all of the time protected virtual bool..

Public Fields versus Automatic Properties

http://stackoverflow.com/questions/1180860/public-fields-versus-automatic-properties

instead of exposing the fields to the outside world. But there are many times when a field is just there to hold a value..

C# Interfaces. Implicit implementation versus Explicit implementation

http://stackoverflow.com/questions/143405/c-sharp-interfaces-implicit-implementation-versus-explicit-implementation

implementation clean or when i need two implemetations. But regardless i rarely use it. I am sure there are more reasons..

How to stop BackgroundWorker on Form's Closing event?

http://stackoverflow.com/questions/1731384/how-to-stop-backgroundworker-on-forms-closing-event

ObjectDisposedException on Invoke ... call understandably. But if I sit in HandleClosingEvent and wait for bgWorker to be done..

What is the correct way to create a single instance application?

http://stackoverflow.com/questions/19147/what-is-the-correct-way-to-create-a-single-instance-application

advocate using the approach shown in the accepted answer. But as it is I do not use the Microsoft.VisualBasic assembly and..

When to Use Static Classes in C#

http://stackoverflow.com/questions/241339/when-to-use-static-classes-in-c-sharp

three are really required parameters 4 7 are optional. But if parameter 6 is specified 7 9 are required to be filled in..

Dynamic LINQ OrderBy on IEnumerable<T>

http://stackoverflow.com/questions/41244/dynamic-linq-orderby-on-ienumerablet

dynamic queries MemberExpression doesn't support it . But here's a way to do it with LINQ to Objects. Note that the choice..

VS2010 does not show unhandled exception message in a WinForms Application on a 64-bit version of Windows

http://stackoverflow.com/questions/4933958/vs2010-does-not-show-unhandled-exception-message-in-a-winforms-application-on-a

my project I tried checking the boxes in Debug Exceptions. But then executions breaks even if I handle the exception in a try.. in this dialog box which would do excatly what I want. But in my projects there is only one column Thrown . c# visual..

Use of Application.DoEvents()

http://stackoverflow.com/questions/5181777/use-of-application-doevents

DoEvents is running. That works user interface is gone. But your code didn't stop it is still executing the loop. That's.. being able to copy and paste something from another window But that's the price. Which is what it takes to use DoEvents safely.. ways to shoot your foot in colorful and inscrutable ways. But with the advantage that you only shoot your own foot it won't..

Proper use of the IDisposable interface

http://stackoverflow.com/questions/538060/proper-use-of-the-idisposable-interface

like database connections sockets window handles etc. But I've seen code where the Dispose method is implemented to free.. resources such as database connections and bitmaps. But suppose that _theList in the above code contained a million.. .NET object and the garbage collector will free it. But do you really want to leave 250MB of memory just sitting there..

What is the best workaround for the WCF client `using` block issue?

http://stackoverflow.com/questions/573872/what-is-the-best-workaround-for-the-wcf-client-using-block-issue

new SomeWCFServiceClient Do something with the client But as noted in this MSDN article wrapping a WCF client in a using..

How to remove all event handlers from a control

http://stackoverflow.com/questions/91778/how-to-remove-all-event-handlers-from-a-control

a control you can do this c.Click new EventHandler mainFormButton_Click or this c.Click mainFormButton_Click and to remove.. EventHandler mainFormButton_Click or this c.Click mainFormButton_Click and to remove an event handler you can do this c.Click.. to remove an event handler you can do this c.Click mainFormButton_Click But how do you remove all event handlers from a control..

ExecuteReader requires an open and available Connection. The connection's current state is Connecting

http://stackoverflow.com/questions/9705637/executereader-requires-an-open-and-available-connection-the-connections-curren

pool to know when a connection can be reused or not. But it's a very important flag because if a connection is in use..

Encrypting & Decrypting a String in C#

http://stackoverflow.com/questions/10168240/encrypting-decrypting-a-string-in-c-sharp

decryptedString SomeStaticClass.Decrypt encryptedString BUT with a minimum of fuss involving salts keys mucking about with..

How do you automatically resize columns in a DataGridView control AND allow the user to resize the columns on that same grid?

http://stackoverflow.com/questions/1025670/how-do-you-automatically-resize-columns-in-a-datagridview-control-and-allow-the

AutoSizeMode of all the columns which does allow resizing BUT doesn't set the initial size according to the data the cells..

Does List<T> guarantee insertion order?

http://stackoverflow.com/questions/1043039/does-listt-guarantee-insertion-order

indexToMoveTo itemToMove This seems to work BUT I am occasionally getting strange results sometimes the order..

How to hook FluentValidator to a Web API?

http://stackoverflow.com/questions/12975291/how-to-hook-fluentvalidator-to-a-web-api

new WebApiFluentValidationModelValidatorProvider ` BUT like this GlobalConfiguration.Configuration.Services.Add typeof..

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

string which will be binded to grid at some later stage BUT BUT BUT... it seems I'm back to square one. The Application.. which will be binded to grid at some later stage BUT BUT BUT... it seems I'm back to square one. The Application again.. which will be binded to grid at some later stage BUT BUT BUT... it seems I'm back to square one. The Application again become..

{"<user xmlns=''> was not expected.} Deserializing Twitter XML

http://stackoverflow.com/questions/1556874/user-xmlns-was-not-expected-deserializing-twitter-xml

to the serializer when you serialize the content BUT im not serializing it so i cant. I also have some code for recieving..

Connecting to SQL Server with Visual Studio Express Editions [closed]

http://stackoverflow.com/questions/188963/connecting-to-sql-server-with-visual-studio-express-editions

SQL Server Compact 3.5 and SQL Server Database File. BUT if you use Visual Web Developer 2008 Express you can connect..

.NET read binary contents of .lnk file

http://stackoverflow.com/questions/2565885/net-read-binary-contents-of-lnk-file

this works fine with IO.File.ReadAllBytes string file . BUT If the target of the shortcut does not exist believe me I want..

Form top most?

http://stackoverflow.com/questions/324463/form-top-most

This should do the trick. Update TopMost should do the job BUT Top most OR AND the Win32 Api call will only work not inside..

How can I conditionally compile my C# for Mono vs. Microsoft .NET?

http://stackoverflow.com/questions/329043/how-can-i-conditionally-compile-my-c-sharp-for-mono-vs-microsoft-net

this question The Mono compiler defines __MonoCS__ BUT BUT BUT the whole point of Mono is that you can take an assembly.. this question The Mono compiler defines __MonoCS__ BUT BUT BUT the whole point of Mono is that you can take an assembly.. question The Mono compiler defines __MonoCS__ BUT BUT BUT the whole point of Mono is that you can take an assembly that..

multimap in .NET

http://stackoverflow.com/questions/380595/multimap-in-net

``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND.. DISCLAIMED. IN NO EVENT SHALL SOLUTIONS DESIGN OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT INDIRECT INCIDENTAL SPECIAL EXEMPLARY.. SPECIAL EXEMPLARY OR CONSEQUENTIAL DAMAGES INCLUDING BUT NOT LIMITED TO PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES LOSS..

WCF HttpTransport: streamed vs buffered TransferMode

http://stackoverflow.com/questions/4043683/wcf-httptransport-streamed-vs-buffered-transfermode

and these results are consistent. Problem solved BUT I cannot explain myself what is happening here. My surprise..

How to flatten an ExpandoObject returned via JsonResult in asp.net mvc?

http://stackoverflow.com/questions/5156664/how-to-flatten-an-expandoobject-returned-via-jsonresult-in-asp-net-mvc

by the browser Key SomeProp Value SomeValueOrClass BUT what I'd really like is to see this SomeProp SomeValueOrClass..

Itextsharp: Adjust 2 elements on exactly one page

http://stackoverflow.com/questions/7590071/itextsharp-adjust-2-elements-on-exactly-one-page

ocuppy just one page. I try to scale the image by percent BUT given that the image size of the image that'll be on the last..

Is an Application Associated With a Given Extension?

http://stackoverflow.com/questions/9540051/is-an-application-associated-with-a-given-extension

I would recommend following the advice in David's answer BUT since you need to detect an association To check whether a file..

Regular expression for decimal number

http://stackoverflow.com/questions/968825/regular-expression-for-decimal-number

0 9 1 3 It allows 0 1 1.2 1.02 1.003 1.030 1 2 1 23 1 234 BUT NOT .1 1 12.1 12 1 1. 1 1.2345 1 2345 share improve this answer..