Tracy.Bai

Focus on Data analysis and Mining

导航

从技术文章所得

var larry = new CustomerBuilder().WithName("Larry").WithAge(30).Build();

The fluent interface applied to the code makes it incredibly simple for anyone to ascertain the intent of this code at a glance.  The key to this ability to easily chain members together in nearly any order is that each member of the class returns a reference to itself.  This reference can then be used to to add additional commands onto the chain.  Let’s take a look at the CustomerBuilder class…

internal class CustomerBuilder
{
    private string _name;
    private int _age;

    public Customer Build()
    {
        return new Customer(_name, _age);
    }

    public CustomerBuilder WithName(string name)
    {
        _name = name;
        return this;
    }

    public CustomerBuilder WithAge(int age)
    {
        _age = age;
        return this;
    }
}

 

var person = new Customer() { Name = "Larry", Age = 30 };

 

 

 

PowerPoint Slide

Keyboard Shortcut

image

Day 1

 

Show Shortcut Keys

image

Day 2

Open Smart Tag

Ctrl + .

Open Smart Tag

Ctrl + Shift + F10

image

Day 3

Navigate Forwards

Ctrl + –

Navigate Backwards

Ctrl + Shift + -

image

Day 4

 

Tools, Options…, Display Line Numbers

image

Day 5

 

Cycle Clipboard Ring

Ctrl + Shift + V

image

Day 6

 

Go to Definition

F12

image

Day 7

 

Go to Line

Ctrl + G

image

Day 8

 

Vertical Block Selection

Alt + Mouse

image

Day 9

View Properties Window

F4

View Properties Window

Alt + Enter

image

Day 10

Comment Selection

Ctrl + K, Ctrl + C

Uncomment Selection

Ctrl + K, Ctrl + U

image

Day 11

 

Toggle Code / Design Views

F7

image

Day 12

Make Lowercase

Ctrl + U

Make Uppercase

Ctrl + Shift + U

image

Day 13

 

Incremental Search

Ctrl + I

image

Day 14

 

Ctrl + Tab Navigator Window

Ctrl + Tab

image

Day 15

 

View Object Browser

Ctrl + Alt + J

image

Day 16

 

Delete Line

Ctrl + L

image

Day 17

 

Add New Item to Project

Ctrl + Shift + A

image

Day 18

 

Close Current Document

Ctrl + F4

image

Day 19

 

Toggle Breakpoint

F9

image

Day 20

 

Find All References

Shift + F12

image

Day 21

Move Cursor One Word Right

Ctrl + Right Arrow

Move Cursor One Word Left

Ctrl + Left Arrow

image

Day 22

 

The Rename Refactor

Ctrl + R, R

image

Day 23

 

Find All References

Shift + F12

image

Day 24

 

Format Document

Ctrl + K, Ctrl + D

image

Day 25

 

View Task List

Ctrl + \, Ctrl + T

image

Day 26

 

Find in Files

Ctrl + Shift + F

image

Day 27

 

Toggle Outlining Expansion

Ctrl + M, Ctrl + M

image

Day 28

 

Close All Documents

Alt + W, L

image

Day 29

 

Save Any Output Window

Ctrl + S

image

Day 30

 

Build Solution

Ctrl + S

image

Day 31

 

Reset Window Layout

Alt, W, R

url rewiting

http://www.addedbytes.com/apache/url-rewriting-for-beginners/

linq 101 examples

http://msdn.microsoft.com/en-us/vcsharp/aa336746.aspx

 

 

posted on 2008-08-07 21:09  Love Fendi  阅读(204)  评论(0编辑  收藏  举报