随笔分类 - C#&dotNet开发
摘要:Interface Key Notes (MSDN Interface)1. Explicit Interface ImplementationThere are 2: implicit and explicit interface implementation. Implicit type is normal to be used. Here, to understand more about ...
阅读全文
摘要:Dictionary: For purposes of enumeration, each item in the dictionary is treated as a KeyValuePair<TKey, TValue> structure representing a value and its key. The order in which the items are re...
阅读全文
摘要:There are 3:1. Console.WriteLine-- it's for console application only.To see in output window: 2. Debug.WriteLine3. Trace.WriteLine (You just have to make sure the the TRACE compiler constant is define...
阅读全文
摘要:#Region is useful to organize code. Some tips to use it:1. Ctrl+K,s to choose #region to insert it for you.2. Right click in the source file (.cs for example), choose outlining submenu, you will find ...
阅读全文
摘要:Delegate is very easy to understand. So no need to waste words here. I would like to talk more about Event in C#.1. [Paste from unleashed C#]An event is a delegate with special features in the areas o...
阅读全文
摘要:For C++:Memory analysis tools: 1. C++ memory leak detector - Memory Validator (http://www.softwareverify.com/index.html)2. Other as references: Purify from IBM Performance profiling tools:For C#: Memory analysis tools: As developers, we are often faced with addressing memory leaks in our applicatio
阅读全文
摘要:There is a pdf talking about this in detail (in my skydrive). Here just list some key points:1. To enable polymophyism, we need: a. Add virtual in Base class functions. Yes, it's same as c++ does. b. ...
阅读全文
摘要:Things declared outside of a class or struct will default to internal (When you define a data type of some kind (class, struct, enum, etc.) you need not specify an access modifier, but be aware that ...
阅读全文
摘要:Using StatementThe using statement obtains one or more resources, executes a statement, and then disposes of the resource. A using statement is translated into three parts:acquisition, usage, and disp...
阅读全文
摘要:C# provides a mechanism for defining declarative tags, called attributes, which you can place on certain entities in your source code to specify additional information. The information that attributes...
阅读全文
摘要:PInvokePlatform Invocation Services (PInvoke) allows managed code to call unmanaged functions that are implemented in a DLL. This tutorial shows you what you need to do to be able to call unmanaged DL...
阅读全文
摘要:I worked on a task: when user clicks a command in the application, the cursor can be that command specific. Some gains:1. Cursor can only accept cur file with only black-white color. It's really a big...
阅读全文
摘要:public class MyClass / public struct MyStruct, you see: there is no base class specification. All reference type and value type inherit from System.Object implicitly in UTS. See below:Ways to get Type...
阅读全文
摘要:How to create a custom mouse cursor?// create any bitmapBitmap b = new Bitmap( 55, 25 );Graphics g = Graphics.FromImage ( b );// do whatever you wishg.DrawString ( "myText", this.Font, Brushes.Blue, ...
阅读全文
摘要:[http://www.jelovic.com/articles/resources_in_visual_studio.htm]Using Resources in Visual Studio .NETby Dejan JelovicConceptsHere's how things break down:In Visual Studio .NET, many resources are no l...
阅读全文
摘要:In C#, you have four types of method parameters: value, ref, out, and params.1. The default parameter type is value.2.If you want calling code to see changes to a value type variable, the parameter ty...
阅读全文
摘要:Kenny Kerr一篇名为C++: The Most Powerful Language for .NET Framework Programming文章中的对比表:描述C++/CLIC#创建引用类型的对象ReferenceType^ h = gcnew ReferenceType;ReferenceType h = new ReferenceType();创建值类型的对象ValueType v...
阅读全文
摘要:JIT compile when calling a specific method first time; NGen.exe can directly convert whole IL exe application to be 汇编 based.JIT与NGen.exe比较JIT运行时编译,NGen.exe在运行前编译;JIT每次编译需要的方法,NGen.exe一次编译整个程序集;JIT将编译...
阅读全文
摘要:All the built-in value types have Parse and TryParse methods when you need conversion from string to those types.
阅读全文
摘要:Besides methods, C# allows to add override to property and indexer. Very cool!
阅读全文

浙公网安备 33010602011771号