¡@

Home 

c# Programming Glossary: class

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

ms.Position 0 return T formatter.Deserialize ms Notes Your class MUST be marked as Serializable in order for this to work. Your..

Encrypt/Decrypt string in .NET

http://stackoverflow.com/questions/202011/encrypt-decrypt-string-in-net

28v vs.95 29.aspx Good luck public class Crypto private static byte _salt Encoding.ASCII.GetBytes o6806642kbM7c5..

Randomize a List<T> in C#

http://stackoverflow.com/questions/273313/randomize-a-listt-in-c-sharp

using System.Threading namespace SimpleLottery class Program private static void Main string args var numbers new.. are 0 string.Join numbers.GetRange 0 5 public static class ThreadSafeRandom ThreadStatic private static Random Local public.. 31 Thread.CurrentThread.ManagedThreadId static class MyExtensions public static void Shuffle T this IList T list..

What is the difference between a field and a property in C#?

http://stackoverflow.com/questions/295104/what-is-the-difference-between-a-field-and-a-property-in-c

fields. Fields should almost always be kept private to a class and accessed via get and set properties. Properties provide.. external way they are accessed by the things that use your class. public class MyClass this is a field. It is private to your.. are accessed by the things that use your class. public class MyClass this is a field. It is private to your class and stores..

Deserialize JSON into C# dynamic object?

http://stackoverflow.com/questions/3142495/deserialize-json-into-c-sharp-dynamic-object

dynamic type It would be nice to skip creating a bunch of classes in order to use the DataContractJsonSerializer. c# .net json.. using System.Web.Script.Serialization public sealed class DynamicJsonConverter JavaScriptConverter public override object.. #region Nested type DynamicJsonObject private sealed class DynamicJsonObject DynamicObject private readonly IDictionary..

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

when Equals method is overridden Given the following class public class Foo public int FooId get set public string FooName.. method is overridden Given the following class public class Foo public int FooId get set public string FooName get set public..

Dynamic LINQ OrderBy on IEnumerable<T>

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

System.Linq using System.Runtime.CompilerServices static class Program private static class AccessorCache private static readonly.. static class Program private static class AccessorCache private static readonly Hashtable accessors new..

Casting vs using the 'as' keyword in the CLR

http://stackoverflow.com/questions/496096/casting-vs-using-the-as-keyword-in-the-clr

public interface IMyInterface void AMethod public class MyClass IMyInterface public void AMethod Do work Other helper.. void AMethod Do work Other helper methods.... public class Implementation IMyInterface _MyObj MyClass _myCls1 MyClass _myCls2.. using System using System.Diagnostics using System.Linq class Test const int Size 30000000 static void Main object values..

What's the difference between String and string?

http://stackoverflow.com/questions/7074/whats-the-difference-between-string-and-string

to use String if you need to refer specifically to the class. e.g. string greet String.Format Hello 0 place This is the style..

Deep cloning objects in C#

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

is used to perform the copy. summary public static class ObjectCopier summary Perform a deep Copy of the object. summary..

C# - Correct Way to Load Assembly, Find Class and Call Run() Method

http://stackoverflow.com/questions/1137781/c-sharp-correct-way-to-load-assembly-find-class-and-call-run-method

Correct Way to Load Assembly Find Class and Call Run Method Sample console program. class Program static..

Making Entity Class Closed for Changes

http://stackoverflow.com/questions/11425993/making-entity-class-closed-for-changes

Entity Class Closed for Changes I have a database relationship as shown..

How does one animate a line on a canvas in C#?

http://stackoverflow.com/questions/15469283/how-does-one-animate-a-line-on-a-canvas-in-c

See if this works for you. MainWindow.xaml Window x Class WpfApplication1.MainWindow xmlns http schemas.microsoft.com..

Method can be made static, but should it?

http://stackoverflow.com/questions/169378/method-can-be-made-static-but-should-it

object instance represents a correctness issue. Utility Class You shouldn't move them to a utility class unless it makes sense..

Encrypt/Decrypt string in .NET

http://stackoverflow.com/questions/202011/encrypt-decrypt-string-in-net

Here's a working example derived from the RijndaelManaged Class documentation and the MCTS Training Kit . EDIT 2012 April This..

How to Convert JSON object to Custom C# object?

http://stackoverflow.com/questions/2246694/how-to-convert-json-object-to-custom-c-sharp-object

WebMethod public static void SaveTeam Object user C# Class that represents the object structure of JSON Object passed in..

Call ASP.NET Function From Javascript?

http://stackoverflow.com/questions/3713/call-asp-net-function-from-javascript

.NET 2.0 or later add the following Interface to your Page Class to make it look like public partial class Default System.Web.UI.Page..

Default visibility for C# classes and members (fields, methods, etc)?

http://stackoverflow.com/questions/3763612/default-visibility-for-c-sharp-classes-and-members-fields-methods-etc

for the default visibility of various aspects of C#. Class types fields methods enums etc. Can someone provide a list of.. found here and here thanks Reed Copsey From the first link Classes and structs that are declared directly within a namespace..

Good or bad practice for Dialogs in wpf with MVVM?

http://stackoverflow.com/questions/3801681/good-or-bad-practice-for-dialogs-in-wpf-with-mvvm

but simple window. I need it to hold my content Window x Class WindowDialog xmlns http schemas.microsoft.com winfx 2006 xaml..

Binding WPF ComboBox to a Custom List

http://stackoverflow.com/questions/561166/binding-wpf-combobox-to-a-custom-list

property is set correctly. Here is my xaml Window x Class WpfApplication6.Window1 xmlns http schemas.microsoft.com winfx..

Properties vs Methods

http://stackoverflow.com/questions/601621/properties-vs-methods

and Methods section of Design Guidelines for Developing Class Libraries In general methods represent actions and properties..

Large Object Heap Fragmentation

http://stackoverflow.com/questions/686950/large-object-heap-fragmentation

Name System.Object MethodTable 00000642788d8ba8 EEClass 00000642789d7660 Size 1056 0x420 bytes Array Rank 1 Number of.. 16 Free total 1568 objects Statistics MT Count TotalSize Class Name 00175e88 784 12544 Free 793040bc 784 421088 System.Object..

POCO vs DTO

http://stackoverflow.com/questions/725348/poco-vs-dto

vs DTO POCO Plain Old CLR or better Class Object DTO Data Transfer Object In this post there is a difference..

Using C#, how does one figure out what process locked a file?

http://stackoverflow.com/questions/860656/using-c-how-does-one-figure-out-what-process-locked-a-file

ipHandle int Win32API.ObjectInformationClass.ObjectBasicInformation ipBasic Marshal.SizeOf objBasic ref nLength.. ipHandle int Win32API.ObjectInformationClass.ObjectTypeInformation ipObjectType nLength ref nLength Win32API.STATUS_INFO_LENGTH_MISMATCH.. ipHandle int Win32API.ObjectInformationClass.ObjectNameInformation ipObjectName nLength ref nLength Win32API.STATUS_INFO_LENGTH_MISMATCH..

Most common C# bitwise operations on enums

http://stackoverflow.com/questions/93744/most-common-c-sharp-bitwise-operations-on-enums

question C# Logical Bitwise Operators C# Bitwise Helper Class Bitwise operators in C# Operator bitwise C# Bit manipulation..

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

be smart to encapsulate ADO.NET functionality into a DB Class me too 10 years ago . Mostly they decide to use static shared.. namespace. All the above speaks against a custom DB Class which encapsulates and reuse all objects. That's the reason..