当前位置:首页 > Application Development with.NET 期末复习笔记
Collection ArrayList
Implements IList
Description
Like an array but shrinks or grows as dataadded
HashTable Queue Stack SortedList 3. ArrayList
IDictionary ICollection ICollection IDictionary
An unordered collection of key/value pairsFirst in, first out collection Last in, first out collection A sorted list of key/value pairs
a. Implements Ilist, ICollection and IEnumerable
Week 9
1. Delegates
Week 10
1. LINQ: Language Integrated Query
Week 11
1. Reflection
Allow programs to add functionality while executing
2. Is and as ? Is
? allows you to ask if an expression is of a particular type. ? Result is a Boolean
? As
? allows you to cast one type as another. If successful it returns the type. If not it returns null-- no exception.
3. Attribute
An attribute is a special kind of class for storing information about program constructs
? You apply the attributes to program constructs in the source code. ? The compiler takes the source code and produces metadata from the attributes and places that in the assembly. ? The metadata can be accessed by other programs.
? You apply the attribute by placing it immediately before the program construct.
? An attribute consists of square brackets [ ] enclosing an attribute name and sometimes a parameter list. [ Serializable ] public class MyClass { . . .
[ MyAttribute(“Simple class”, “Version 3.57”) ] public AnotherClass { . . .
4. obsolete attribute
? allows you to mark a program section as obsolete and display a warning message when the code is compiled. class Program {
[Obsolete(“Use method FooTwo”)] static public void Foo(string str) { // . . . }
static public void FooTwo(string str) { // . . . }
static void Main {
Foo(“In main”) } }
? This code will compile and run but, it will generate the following compiler error
?AttrObs.Program.Foo(string)? is obsolete: ?Use method FooTwo?
? You can add a flag to the attribute which says to generate a compiler error rather than a warning
[Obsolete(“Use FooTwo”, true)]
5. Conditional attribute
allows you to include or not include any calls of a particular method.
6. Nullable
7. Whenever the relational operators are applied to nullable the result is always false if one or both of the items is a nullable equal to null. Nullable Logic: X true false null null null
? Note: If a nullable is equal to null then applying the ! operator returns null.
int? x = null; if (!x == null) // true
Y null null true false null
X | Y true null true null null
X & Y null false null false null
Week 12
1. WPF - Windows Presentation Foundation
2. XAML -eXtensible Application Markup language
3. Graphic Devices and Vector Graphics?
? There are a huge number of display devices out in the market, each with varying capabilities.
? WPF exploits whatever graphics processing unit (GPU) is available on a system to offload as much work as possible to it.
? To take advantage of all these capabilities, WPF relies entirely on vector graphics, rather than bit mapped graphics, allowing images and interface
共分享92篇相关文档