¡@

Home 

c# Programming Glossary: prefer

Transitioning from Windows Forms to WPF

http://stackoverflow.com/questions/15681352/transitioning-from-windows-forms-to-wpf

classes typically Models and ViewModels And personally I prefer to type all my XAML out by hand since it's faster and doesn't..

String output: format or concat in C#?

http://stackoverflow.com/questions/16432/string-output-format-or-concat-in-c

or concat strings. Which of the following styles do you prefer var p new FirstName Bill LastName Gates Console.WriteLine 0..

Simple 2 way encryption for C#

http://stackoverflow.com/questions/165808/simple-2-way-encryption-for-c-sharp

but something a little stronger than ROT13 or Base64. I'd prefer something that is already included in the .Net framework 2.0..

Using CookieContainer with WebClient class

http://stackoverflow.com/questions/1777221/using-cookiecontainer-with-webclient-class

and CookieContainer.GetCookieHeader respectively. I prefer the former approach since it's easier for the caller and requires..

Creating a DateTime in a specific Time Zone in c# fx 3.5

http://stackoverflow.com/questions/246498/creating-a-datetime-in-a-specific-time-zone-in-c-sharp-fx-3-5

How Can I Set Processor Affinity in .NET?

http://stackoverflow.com/questions/2510593/how-can-i-set-processor-affinity-in-net

thread's IdealProcessor property to allow the scheduler to prefer running the thread on a specified processor without guarantee..

What is the best way to store user settings for a .NET application?

http://stackoverflow.com/questions/26369/what-is-the-best-way-to-store-user-settings-for-a-net-application

2 that would change to a different folder right I'd prefer to have a single folder per user to store settings regardless..

How do I build a JSON object to send to an AJAX WebService?

http://stackoverflow.com/questions/2737525/how-do-i-build-a-json-object-to-send-to-an-ajax-webservice

myData1 myRequest2 JSON.stringify myData2 if you prefer another version of JSON encoder. share improve this answer..

How to provide user name and password when connecting to a network share

http://stackoverflow.com/questions/295538/how-to-provide-user-name-and-password-when-connecting-to-a-network-share

the thread identity or P Invoke WNetAddConnection2. I prefer the latter as I sometimes need to maintain multiple credentials..

C# member variable initialization; best practice?

http://stackoverflow.com/questions/298183/c-sharp-member-variable-initialization-best-practice

Foo get set public Bar ctor Foo Other than that I tend to prefer the field initializer syntax I find it keeps things localized.. go. Likewise if you have multiple constructors it would be preferable for the fields to always get set the same way so you might..

When should I dispose of a data context

http://stackoverflow.com/questions/389822/when-should-i-dispose-of-a-data-context

of them in most cases and that's by design. I personally prefer to do so anyway as it's easier to follow the rule of dispose..

Is there any significant difference between using if/else and switch-case in C#?

http://stackoverflow.com/questions/395618/is-there-any-significant-difference-between-using-if-else-and-switch-case-in-c

To sum it up if number of conditions is more than 5 or so prefer SWITCH over IF otherwise use whatever looks better. share improve..

Best practices for exception management in Java or C#

http://stackoverflow.com/questions/409563/best-practices-for-exception-management-in-java-or-c-sharp

them into error codes. Why do you think the caller would prefer error codes over exceptions when the latter is the default in..

How do you get the index of the current iteration of a foreach loop?

http://stackoverflow.com/questions/43021/how-do-you-get-the-index-of-the-current-iteration-of-a-foreach-loop

using an indexer and the for loop construct. I greatly prefer using a for loop in this situation compared to tracking the..

How do I get the path of the assembly the code is in?

http://stackoverflow.com/questions/52797/how-do-i-get-the-path-of-the-assembly-the-code-is-in

NUnit where assemblies run from a temporary folder so I prefer to use CodeBase which gives you the path in URI format then..

Accessing a Shared File (UNC) From a Remote, Non-Trusted Domain With Credentials

http://stackoverflow.com/questions/659013/accessing-a-shared-file-unc-from-a-remote-non-trusted-domain-with-credentials

a couple libraries I could use for that approach but I'd prefer to reduce my dependencies if I can. I've searched MSDN for either..

Embedding unmanaged dll into a managed C# dll

http://stackoverflow.com/questions/666799/embedding-unmanaged-dll-into-a-managed-c-sharp-dll

I have used this technique and it works well. You may prefer to just link it to the assembly as a separate file as Michael..

Dynamic enum in C#

http://stackoverflow.com/questions/725043/dynamic-enum-in-c-sharp

code automatically from database look up tables and would prefer it to be completely dynamic. c# database dynamic enums share..

Deep cloning objects in C#

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

also from the originally referenced source In case you prefer to use the new extension methods of C# 3.0 change the method..

Is it possible to dynamically compile and execute C# code fragments?

http://stackoverflow.com/questions/826398/is-it-possible-to-dynamically-compile-and-execute-c-sharp-code-fragments

is it possible to compile and or execute this code I would prefer to compile it for performance reasons. At the very least I could..