编码笔记

导航

04 2012 档案

Delphi XE2 IDE Classic Keyboard Shortcuts
摘要:Shortcut Action Alt+[Finds the matching delimiter (forward)Alt+]Finds the matching delimiter (backward)Alt+Page DownGoes to the next tabAlt+Page UpGoes to the previous tabAlt+Shift+Down ArrowMoves the cursor down one line and selects the column from the left of the starting cursor positionAlt+Shift+ 阅读全文

posted @ 2012-04-15 23:37 封三郎 阅读(349) 评论(0) 推荐(0)

Delphi XE2 Default Keyboard Shortcuts
摘要:Shortcut Action Alt+[Finds the matching delimiter (forward).Alt+]Finds the matching delimiter (backward).Alt+Left ArrowGo back after Alt+Up Arrow or Ctrl+Click (go to declaration) operation.Alt+F7Go to previous error or message in Messages View.Alt+F8Go to next error / message in Messages View.Alt+P 阅读全文

posted @ 2012-04-15 23:34 封三郎 阅读(609) 评论(0) 推荐(0)

datasnap传输流/文件问题
摘要:我在datasnap服务器里面定义了方法:procedure UpdateDoc(ItemID : integer; doc : TStream);客户端AServerMethods_PublicClient := TServerMethods_PublicClient.Create(DM_Client.SQLConnection1.DBXConnection); ItemText := TMemoryStream.Create; try ItemText.LoadFromFile('E:\private\ksxt\Source\Client\Win32\Debug\blank.rt. 阅读全文

posted @ 2012-04-09 11:37 封三郎 阅读(1263) 评论(1) 推荐(0)

查询条件的封装(类图)
摘要: 阅读全文

posted @ 2012-04-06 22:29 封三郎 阅读(663) 评论(0) 推荐(1)

查询条件的封装(小结)
摘要:截至今天,查询条件的封装第一阶段的工作基本完成了。在之前的基础上做了一些调整,由于D7与XE/XE2的差异,某些思路也做了调整。查询条件项的驱动控制由于是使用TCollection和TCollectionItem来实现的,所以不能作为查询条件项的属性来进行选择(应该是只有继承自TComponent的组件才可以作为属性的选择对象),取而代之的是采用Index的方式来进行绑定,这个我觉得是设计上的一个缺陷,并没有完全符合我最初的设想,在使用上不够简便直观。如果是在XE2下可以有更好的选择,可以用TCustomAttribute加反射机制来实现持久化配置数据的动态绑定。常量单元ConditionCo 阅读全文

posted @ 2012-04-06 21:58 封三郎 阅读(1928) 评论(0) 推荐(2)

查询条件的封装(二)
摘要:TConditionItem 1 { TConditionItem } 2 3 procedure TConditionItem.Assign(Source: TPersistent); 4 begin 5 if Source is TConditionItem then 6 begin 7 if Assigned(Collection) then Collection.BeginUpdate; 8 try 9 //RestoreDefaults;10 ConditionName := TConditionItem(Source).Condit... 阅读全文

posted @ 2012-04-04 21:26 封三郎 阅读(613) 评论(0) 推荐(1)

查询条件的封装(一)
摘要:因为现行的项目是使用cxGrid作为主要的控件,通用的查询条件模块也是依赖cxGrid来实现的。但是现行的实现方式和设计思路的灵活性和维护性都比较差,存在每次改动代码量较大、修改处多且分散的问题,所以我考虑重构一下,从设计上改变目前的方式。初步的想法是,cxGrid不动,通过一个UI类来控制cxGrid的显示;设计一个条件项类和条件项列表类,用于程序员在设计器可视化设计查询条件;最后有一个业务逻辑控制类,可以控制每一个查询条件项,定义其获取条件值的方式,通过这种设计将界面与逻辑分离。以前有前辈指点过,也有大牛强调过,界面、业务、数据必须分离,但是,我以为对于业务逻辑来讲,它本身就是和数据紧密结 阅读全文

posted @ 2012-04-04 21:04 封三郎 阅读(1532) 评论(0) 推荐(0)

XE2的一些新东西
摘要:当然某些东西可能在XE2之前,甚至2010之前就有了,不过因为我之前没有接触到,所以也一并在这里记录一下。 扩展属性Delphi提供了一个TCustomAttribute类,该类可以为对象的属性、方法、成员等进行扩展描述,语法格式:[TCustomAttribute()]。下面举一个例子:先定一个扩展属性类TInterceptorAttribute:View Code 1 type 2 TInterceptorAttribute = class sealed(TCustomAttribute) 3 private type 4 TInterceptInfo = class 5... 阅读全文

posted @ 2012-04-01 09:47 封三郎 阅读(1396) 评论(0) 推荐(2)