8月28日至9月3日备忘录

1)虚函数virtual和override的使用。

2)Path.ChangeExtension(destinationFileName,stringExtensionChanged);

3)File.Exist()备忘录

4)字体Font的使用,Font font=new Font("KaiTi",12);

5)画刷的使用:

  eg1:Brush brush=new Brush(Color.Azure);

  eg2:Brush brush=new HatchBrush(HatchStyle.Vertical, Color.FromArgb(128, Color.LightBlue),Color.FromArgb(128,Color.LightGray));

6)Color的使用,Color.FromArgb(int,Color);

7)矢量图形的格式化,StringFormate stringFormate=new StringFormate(){Alignment=StringAligment.Center,LineAligment=StringAligment.Center};

8)Graphics的使用,Graphics graphics=new Graphics();

  eg1:g.DrawString(stringText,font,brush,rectangle,stringFormate);

  eg2:g.FillRectangle(brush,rectangle);

  eg3:g.DrawRectangle(p, rectangle.X,rectangle.Y,rectangle.Width,rectangle.Height);

9)MVP模式下manager在注销(CleanUp)时需注意对成员变量的恢复默认值。

10)避免窗口传递参数的耦合,使用数据结构传值,如,类、结构体、布尔值。根据数据结构值,避免复杂的逻辑判断,便于分类处理业务逻辑。

11)对于UI数据的缓存处理,应直接针对已缓存的数据,避免新创建成员变量进行特殊数据缓存便于调用,看似减少操作,实则消耗内存。

12)多了平行界面调用同一个业务处理方法,应将该方法置于公有类中调用,避免放在某个界面的类中处理。

posted @ 2017-09-04 10:48  牧码良匠  阅读(151)  评论(0编辑  收藏  举报