随笔分类 -  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 ... 阅读全文
posted @ 2010-05-11 14:20 能巴 阅读(313) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2010-05-06 11:56 能巴 阅读(233) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2010-04-15 14:17 能巴 阅读(175) 评论(0) 推荐(0)
摘要:#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 ... 阅读全文
posted @ 2010-04-11 17:18 能巴 阅读(206) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2010-04-06 23:13 能巴 阅读(214) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2010-04-05 20:30 能巴 阅读(1100) 评论(0) 推荐(0)
摘要: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. ... 阅读全文
posted @ 2010-04-05 19:03 能巴 阅读(242) 评论(0) 推荐(0)
摘要: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 ... 阅读全文
posted @ 2010-04-02 15:52 能巴 阅读(209) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2010-04-02 14:29 能巴 阅读(448) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2010-04-01 18:03 能巴 阅读(250) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2010-04-01 17:45 能巴 阅读(310) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2010-03-30 16:20 能巴 阅读(202) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2010-03-30 13:45 能巴 阅读(204) 评论(0) 推荐(0)
摘要: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, ... 阅读全文
posted @ 2010-03-29 17:53 能巴 阅读(147) 评论(0) 推荐(0)
摘要:[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... 阅读全文
posted @ 2010-03-18 14:06 能巴 阅读(391) 评论(0) 推荐(0)
摘要: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... 阅读全文
posted @ 2010-03-16 14:56 能巴 阅读(377) 评论(0) 推荐(0)
摘要:Kenny Kerr一篇名为C++: The Most Powerful Language for .NET Framework Programming文章中的对比表:描述C++/CLIC#创建引用类型的对象ReferenceType^ h = gcnew ReferenceType;ReferenceType h = new ReferenceType();创建值类型的对象ValueType v... 阅读全文
posted @ 2010-03-10 13:04 能巴 阅读(961) 评论(0) 推荐(0)
摘要: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将编译... 阅读全文
posted @ 2010-03-10 12:56 能巴 阅读(372) 评论(0) 推荐(0)
摘要:All the built-in value types have Parse and TryParse methods when you need conversion from string to those types. 阅读全文
posted @ 2010-03-03 17:24 能巴 阅读(149) 评论(0) 推荐(0)
摘要:Besides methods, C# allows to add override to property and indexer. Very cool! 阅读全文
posted @ 2010-03-03 16:51 能巴 阅读(122) 评论(0) 推荐(0)