整理笔记
- 整理绿色皮笔记本
- app.coffig
- node
- path(wpf)
- Property(wpf)
- timer
- background Worker
- xml
- adorner(wpf)
- string vs stream
- c# 多态
- socket
- Application
整理绿色皮笔记本
app.coffig
app.config - application user.config - user
Because there is no configuration file model for class libraries, application settings do not apply for Class Library projects. // 类库是没有配置文件的
Therefore, being able to store settings in separate files for frequently-used and infrequently-used groups can save time in loading and saving settings. // 可以自己再在proj根目录下添加配置文件
node
.exit
退出node command
path(wpf)
path, 一系列相互连接的直线和曲线。(可闭合,闭合后组成了封闭的图形)
path.stroke 画刷
path.strokeness 画刷粗细
path.data 连接点位置数据
Property(wpf)
dependency Property -propdp(vs shortcut) attached property -propa clr property -prop
Ojbect -clr 对象 Dependceny object - 依赖对象
wpf所有的控件都继承自 dependency object, 且大部分属性都实现了依赖化(即 dependency property)
timer
- system.windows.forms.timer -隐藏控件(winform)
- system.windows.Threading.DispatcherTimer - wpf界面线程timer
- system.Threading.Timer -generics,通常使用
- system.Timers.Timer - server-based(通常服务端使用)
background Worker
bg dowork执行中发生异常,则会执行它的complete函数流程
xml
- system.xml.xmlreader
- system.windows.markup.xamlreader
- system.io.stringreader
adorner(wpf)
adorner,装饰模式
attached, 附加属性
string vs stream
A string is basically stored in memory; its contents are completely available at the time you receive the String instance. You can directly search the string or find other information - such as the length - of the string.
If you receive a Reader instance you don’t know the size of the string, and many functions such as searching are not (directly) available. On the other hand, you don’t need to store the entire string in memory.
c# 多态
- 里氏替换原则 - 派生类实例可以当作基类对象使用
实现多态
- 虚方法实现多态(virtual)(父类可以实例化)
- 抽象类实现多态(abstract)(抽象类不可以实例化)
- 接口实现多态(Interface)(类型实例可以当作接口类型使用)
socket
system.net.sockets.socket.SendFile(string fileName)
;
- the preBuffer and postBuffer parameters default to null.
- If you are using a connectionless protocol, you must call Connect before calling this method, otherwise SendFile throws a SocketException exception.
- If you are using a connection-oriented protocol, you must either use Connect to establish a remote host connection or use Accept to accept an incoming connection.
Application
application 有一个getcookie的方法。var aa = App.GetCookie(new Uri("https://www.baidu.com"));
// out: BAIDUID=38CAF620DF81AD49EA0B61BA1AF4BD2F:FG=1; BIDUPSID=38CAF620DF81AD49EA0B61BA1AF4BD2F; PSTM=1493376354