Brave Ostrich

我的英文博客敬请访问!
Counting...

Microsoft Visual Studio 2005 Unleashed翻译请教【2】

  1. (You edit macro code using the code editor just as you would to edit any other document with Visual Studio.) To rework this macro, you can start by establishing a recursive helper routine that takes in a UIHierarchyItem object, toggles its Expanded property to True, and calls itself for each sub item found in the UIHierarchyItems collection:

    (

    For Each subNode As UIHierarchyItem In node.UIHirerarchyItems

    ExpandNodes(subNode)

    Next

    node.UIHierarchyItems.Expanded = True

    )

    【说明】括号中为辅助理解。文中并没有给出递归程序的签名,但是很容易猜出应该是:Sub ExpandNodes(UIHierarchyItem node)。

    【难点】如何组织成符合汉语习惯的语序。

    【目前翻译】(使用宏代码编辑器编辑宏和在Visual Studio中编辑其他文档的方式没什么两样。)回到刚才的宏,首先你可以创建一个递归的助手(工具??)程序,在这个程序以UIHierarchyItem对象为参数(后面未贴出的部分代码中显示确实将UIHierarchyItem作为参数,这里作者使用take in,也暗示了这一点),把它的Expanded属性(译者注:实际上是它的子项的集合UIHierarchyItems的属性)设置为True,并且对其子项集合UIHierarchyItems中的每一项(译者注:也是UIHierarchyItem)递归的调用这个程序。

  2. Then, to kick things off, you need a parent, controlling routing that instantiates a window object (representing the Solution Explorer) and grabs the root-level UIHierarchy object from the window.

    【说明】继续讨论上一段中的递归程序。

    【难点】仍然是语言习惯问题。

    【目前翻译】所以,我们需要一个控制程序来启动这个递归程序,一方面我们需要从这个控制程序获得窗口对象(即解决方案资源管理器),同时我们还需要从这个窗口中获得UIHierarchy对象的根节点。

posted on 2007-03-27 22:35 勇敢的鸵鸟 阅读(233) 评论(2)  编辑 收藏 所属分类: E Other Tech ArticlesJ Translations

评论

#1楼  2007-04-04 14:29 做人要低调 [未注册用户]

recursive helper routine 递归的辅助函数,这个辅助函数。。。   回复  引用    

#2楼  2007-04-07 15:35 deerchao      

翻译得基本上很不错了,如果能对(汉语)长句的语法更注重一点,可能效果会更好一点。比如说,长句里面最好主语都是一个;有了“首先”,就要有“其次”或“第二”等相互呼应。

(使用代码编辑器编辑宏和在Visual Studio中编辑其他文档的方式没什么两样)要想编辑这个宏,你可以从创建一个递归的辅助方法开始。这个方法接受一个UIHierarchyItem对象作为参数,把它的Expanded属性(译者注:实际上是它的子项集合UIHierarchyItems的属性)设置为True,并且对其子项集合UIHierarchyItems中的每一项(译者注:也是UIHierarchyItem)递归地调用这个方法。   回复  引用  查看    


标题  
姓名  
主页
Email (只有博主才能看到) 
验证码 *  看不清,换一张 [登录][注册]
内容(请不要发表任何与政治相关的内容)  
  登录  使用高级评论  新用户注册  返回页首  恢复上次提交      
该文被作者在 2007-06-10 20:41 编辑过