C#?????????????????
???????????? ???????[ 2013/10/10 15:46:05 ] ????????
????27. ????????????????????????
????//????
????public enum Color : long
????{
????Red??Green??Blue
????}
????28. ???if?????????????if???????????????????????
????29. ??????????????????????
????30. ??????????????е??÷???bool??????????????t?????????????Щ?????????
????bool IsEverythingOK()
????{…}
????//????
????if (IsEverythingOK ())
????{…}
????//?滻????
????bool ok = IsEverythingOK();
????if (ok)
????{…}
????31. ??????????0????????顣
????32. ????????????????????????????????顣
????public class MyClass
????{}
????MyClass[] array = new MyClass[100];
????for(int index = 0; index < array.Length; index++)
????{
????array[index] = new MyClass();
????}
????33. ?????public ?? protected?????????????????????????
????34. ?????????????new?????override?滻??
????35. ?????sealed???????????public ?? protected?????????virtual???
????36. ???????interop(COM+ ????????dll)??????????ò?????????(unsafe code)??
????37. ?????????????????as?????????м?????????????
????Dog dog = new GermanShepherd();
????GermanShepherd shepherd = dog as GermanShepherd;
????if (shepherd != null )
????{…}
????38. ????????????е????
????a) Copy a delegate to a local variable before publishing to avoid concurrency race
????condition.
????b) ???????????????????????null
public class MySource
{
public event EventHandler MyEvent;
public void FireEvent()
{
EventHandler temp = MyEvent;
if(temp != null )
{
temp(this??EventArgs.Empty);
}
}
}
????39. ????????????????????????????????????滻??Щ??????
public class MySource
{
MyDelegate m_SomeEvent ;
public event MyDelegate SomeEvent
{
add
{
m_SomeEvent += value;
}
remove
{
m_SomeEvent -= value;
}
}
}
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11