随笔分类 - C#----syntax----基本语法
主要描述了我在学习C#时遇见的问题,以及经验
摘要:coordinate thread shutdown
阅读全文
摘要:首先看一个Interface1 Public Interface ISavable2 {3 4 5 string Save();6 7 }接着让一个Class继承这个Interface 1 public Class Catgory:ISavable 2 { 3 public string Save() 4 { 5 6 return "catogry save!" 7 8 } 9 10 string ISavable.Save()//explicit Interface Implementation11 {12 13 14 return "Isavable save
阅读全文
摘要:An implicitly implemented interface member is, by default, sealed. It must bemarked virtualor abstractin the base class in order to be overridden. For example: 1 public interface IUndoable { void Undo(); } 2 public class TextBox : IUndoable 3 { 4 public virtualvoid Undo() 5 { 6 Console.WriteLine (&q
阅读全文
摘要:Static field initializers run just beforethe static constructor is called. If a type has nostatic constructor, field initializers will execute just prior to the type being used—or anytime earlierat the whim of the runtime. (This means that the presence of astatic constructor may cause field initial.
阅读全文
摘要:Lambda expressions and captured variables As we saw, a lambda expression is the most powerfulway to pass data to a thread. However, you must becareful about accidentally modifying captured variablesafter starting the thread, because these variablesare shared. For instance, consider the following: 1
阅读全文
浙公网安备 33010602011771号