c# Programming Glossary: private
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 summary.. object. if aesAlg null aesAlg.Clear return plaintext private static byte ReadByteArray Stream s byte rawLength new byte..
Randomize a List<T> in C# http://stackoverflow.com/questions/273313/randomize-a-listt-in-c-sharp System.Threading namespace SimpleLottery class Program private static void Main string args var numbers new List int Enumerable.Range.. 0 5 public static class ThreadSafeRandom ThreadStatic private static Random Local public static Random ThisThreadsRandom ..
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 expose fields. Fields should almost always be kept private to a class and accessed via get and set properties. Properties.. your class. public class MyClass this is a field. It is private to your class and stores the actual data. private string _myField.. It is private to your class and stores the actual data. private string _myField this is a property. When you access it uses..
Deserialize JSON into C# dynamic object? http://stackoverflow.com/questions/3142495/deserialize-json-into-c-sharp-dynamic-object new typeof object #region Nested type DynamicJsonObject private sealed class DynamicJsonObject DynamicObject private readonly.. private sealed class DynamicJsonObject DynamicObject private readonly IDictionary string object _dictionary public DynamicJsonObject.. var sb new StringBuilder ToString sb return sb.ToString private void ToString StringBuilder sb var firstInDictionary true foreach..
Dynamic LINQ OrderBy on IEnumerable<T> http://stackoverflow.com/questions/41244/dynamic-linq-orderby-on-ienumerablet using System.Runtime.CompilerServices static class Program private static class AccessorCache private static readonly Hashtable.. static class Program private static class AccessorCache private static readonly Hashtable accessors new Hashtable private static.. private static readonly Hashtable accessors new Hashtable private static readonly Hashtable callSites new Hashtable private static..
WebBrowser Control in a new thread http://stackoverflow.com/questions/4269800/webbrowser-control-in-a-new-thread the DocumentCompleted event otherwise. Some sample code private void runBrowserThread Uri url var th new Thread var br new..
Creating a blocking Queue<T> in .NET? http://stackoverflow.com/questions/530211/creating-a-blocking-queuet-in-net todo might be worth changing this into a proper QUEUE private AutoResetEvent _FullEvent new AutoResetEvent false internal.. false internal T this int i get return T List i private int _MaxSize internal int MaxSize get return _MaxSize set .. new IEnumerator GetEnumerator return List.GetEnumerator private void checkSize if Count MaxSize Trace.WriteLine string.Format..
Random number generator only generating one random number http://stackoverflow.com/questions/767999/random-number-generator-only-generating-one-random-number Next on the same instance. Function to get random number private static readonly Random random new Random private static readonly.. number private static readonly Random random new Random private static readonly object syncLock new object public static int.. of these approaches however another approach might be private static readonly ThreadLocal Random appRandom new ThreadLocal..
C# generic list <T> how to get the type of T? [duplicate] http://stackoverflow.com/questions/1043755/c-sharp-generic-list-t-how-to-get-the-type-of-t object sender SelectionChangedEventArgs e Reflect Private void Reflect foreach PropertyInfo pi in lbxObjects.SelectedItem.GetType..
How to Generate Unique Public and Private Key via RSA http://stackoverflow.com/questions/1307204/how-to-generate-unique-public-and-private-key-via-rsa to Generate Unique Public and Private Key via RSA I am building a custom shopping cart where CC numbers.. rsa new RSACryptoServiceProvider cspParams string publicPrivateKeyXML rsa.ToXmlString true string publicOnlyKeyXML rsa.ToXmlString.. key is valid. In Default.aspx.cs public void DownloadNewPrivateKey_Click object sender EventArgs e StreamReader reader new StreamReader..
Reducing memory usage of .NET applications? http://stackoverflow.com/questions/1343374/reducing-memory-usage-of-net-applications the task manager reports the following Working Set 9364k Private Working Set 2500k Commit Size 17480k It's a little better if.. better if it's compiled just for x86 Working Set 5888k Private Working Set 1280k Commit Size 7012k I then tried the following.. on x86 Release outside Visual Studio Working Set 2300k Private Working Set 964k Commit Size 8408k Which is a little better..
Order of items in classes: Fields, Properties, Constructors, Methods [closed] http://stackoverflow.com/questions/150479/order-of-items-in-classes-fields-properties-constructors-methods items in terms of class structure Does it go Public Fields Private Fields Properties Constructors Methods I'm curious if there..
Am I Running as a Service http://stackoverflow.com/questions/200163/am-i-running-as-a-service result. Return CBool _isService End Get End Property Private Shared _isService As Nullable Of Boolean Nothing #End Region..
Why does C# not provide the C++ style 'friend' keyword? http://stackoverflow.com/questions/203616/why-does-c-sharp-not-provide-the-c-style-friend-keyword EDIT Let me clarify how the friend keyword undermines OOP. Private and protected variables and methods are perhaps one of the most..
Can't get sql server compact 3.5 / 4 to work with ASP .NET MVC 2 http://stackoverflow.com/questions/3223359/cant-get-sql-server-compact-3-5-4-to-work-with-asp-net-mvc-2 the bin folder for the code. My folly was thinking the Private folder needed to be included but it doesn't. Do not put the.. C Program Files Microsoft SQL Server Compact Edition v4.0 Private UPDATE Use System.Data.SqlServerCe.dll from the Desktop folder..
Trying to use the C# SpellCheck class http://stackoverflow.com/questions/4024798/trying-to-use-the-c-sharp-spellcheck-class Me.Size New System.Drawing.Size 100 20 End Sub Private Sub box_TextChanged ByVal sender As Object ByVal e As EventArgs..
Private inner classes in C# - why aren't they used more often? http://stackoverflow.com/questions/454218/private-inner-classes-in-c-sharp-why-arent-they-used-more-often inner classes in C# why aren't they used more often I am relatively..
How do I suspend painting for a control and its children? http://stackoverflow.com/questions/487661/how-do-i-suspend-painting-for-a-control-and-its-children wParam As Integer ByVal lParam As Integer As Integer Private Const WM_SETREDRAW As Integer 11 ' Extension methods for Control..
Access a Remote Directory from C# http://stackoverflow.com/questions/5433570/access-a-remote-directory-from-c-sharp _networkName 0 true #endregion #region Private static methods summary The WNetAddConnection2 function makes..
What is the difference between Public, Private, Protected, and Nothing? http://stackoverflow.com/questions/614818/what-is-the-difference-between-public-private-protected-and-nothing is the difference between Public Private Protected and Nothing All my college years I have been using..
How to implement full row selecting in GridView without select button? http://stackoverflow.com/questions/6250545/how-to-implement-full-row-selecting-in-gridview-without-select-button this.GridView1 Select e.Row.RowIndex VB.Net Private Sub GridView1_RowCreated ByVal sender As Object ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs..
ObservableCollection Doesn't support AddRange method, so I get notified for each item added, besides what about INotifyCollectionChanging? http://stackoverflow.com/questions/670577/observablecollection-doesnt-support-addrange-method-so-i-get-notified-for-each Next End If MyBase.OnCollectionChanged e End Sub Private Sub Item_PropertyChanged ByVal sender As T ByVal e As ComponentModel.PropertyChangedEventArgs.. As IEnumerable Of T m_Action action m_Items items End Sub Private m_Action As NotifyCollectionChangedAction Public ReadOnly Property.. Get Return m_Action End Get End Property Private m_Items As IList Public ReadOnly Property Items As IEnumerable..
|