一区二区三区日韩精品-日韩经典一区二区三区-五月激情综合丁香婷婷-欧美精品中文字幕专区

分享

Chapter 2. B Generating a CAB Project with SCSF

 MG的圖書館 2009-04-06

B. Generating a CAB Project with SCSF

  1. The SCSF contains a wizard for generating the projects that comprise a CAB application. After installing the SCSF and its associated utilities, you see the Guidance Packages item in the New Project dialog box in Visual Studio. The Smart Client Development item underneath it contains a template named Smart Client Application, as shown in Figure 2-1.

     

    Figure 2-1. Visual Studio template for generating Smart Client Application.

  2. The SCSF needs to know the location of the CAB dynamic linked libraries (DLLs) and of the Enterprise Library DLLs because it uses both in its generated code. It prompts you for them using the box shown in Figure 2-2. You also need to enter the namespace to be used for the classes in your generated project.

     

    Figure 2-2. Wizard choices for generating Smart Client application.

    Note

     

    Not all SCSF project developers like using the Enterprise Library in their CAB programs. You can actually remove it quite easily from the code generated by the SCSF if you want. Just open each generated project and remove the references to the Enterprise Library DLLs. Then compile the code and see where the errors are. There are only about three locations in which you'll have to remove EntLib code, generally relating to exception handling. Just make sure you put in your own exception handling in its place and don't just leave it undone.


  3. The SCSF generates four or five projects containing many files for a complete CAB application. Figure 2-3 shows the Visual Studio Solution Explorer displaying the results of such a generation. I will now discuss the purpose of each of the projects that you see.

    Figure 2-3. Projects generated by SCSF.

    The Shell project, as we've seen, is the main outer container of the application. It contains classes for the shell application and the shell form. It also contains the app.config file used by most .NET applications, and a ProfileCatalog.xml file used by the default module enumerator service, which we meet later in this chapter.

    The Infrastructure.Module project builds a DLL that is loaded by the module loader service when the project starts up. It creates a child WorkItem, which it adds to the WorkItem chain. Most CAB applications contain several modules that can create a WorkItem, so one of the reasons that the wizard generates this module is to demonstrate how it's done. A production application would probably use an infrastructure module to contain its own services and other resources rather than clutter up the shell project with them.
    Module項(xiàng)目編譯了一個(gè)DLL,當(dāng)這個(gè)項(xiàng)目啟動(dòng)的時(shí)候通過Module Loader Service加載這個(gè)DLL。它生成了一個(gè)子的WorkItem加入WorkItemChain中。大部分CAB Application都包含了幾個(gè)Module,他們都能生成WorkItem。所以向?qū)蛇@個(gè)Module的原因是說明Module如何運(yùn)行的。 一個(gè)生產(chǎn)的Application應(yīng)該使用一個(gè)infrastructure module來包含自己的服務(wù)和其他資源,而不是和Shell Project放在一起。

    The Infrastructure.Library project contains the implementation of services that the SCSF adds to a CAB project. The action catalog service, which I discuss in Chapter 7, is an example of this sort of service. This DLL is generally deployed with the shell project and managed by the infrastructure team.

    Libray項(xiàng)目包含了SCSF添加到CAB中的服務(wù)實(shí)現(xiàn)。Action Catglog Service,7章有個(gè)這個(gè)Service的例子。這個(gè)DLL一般和Shell項(xiàng)目一起部署,并由infrastructure team 管理。

    The Infrastructure.Interface project contains the definitions of service interfaces, as distinct from their implementations. For example, it contains the definition of the IActionCatalogService interface, which is implemented in the Infrastructure.Library project I mentioned in the preceding paragraph. It also contains the implementation of certain core classes that we want all projects to use, such as ControlledWorkItem. In this sense, you might consider it a part of CAB 1.1. It also contains the definitions of string constants used for indexing many of the WorkItem chain's collections. This centralizing of string names avoids bugs and collisions later. You distribute this DLL to all development teams in the CAB project. This is the one piece of code that the developers actually do share, so you want it to be as sparse and as generic as possible—hence the inclusion of interface definitions rather than class implementations.

    Interface項(xiàng)目包含了Service Interface的定義,和它們的實(shí)現(xiàn)區(qū)別開來。例如,他包含了IActionCatalogService 接口的定義,這個(gè)接口在Library項(xiàng)目中實(shí)現(xiàn)。他也包括了我們想所有項(xiàng)目都使用的核心類,例如ControledWorkItem。他也包括了一些字符串的常量定義,用來索引WorkItem Chain集合。這個(gè)集中字符串名字的做法避免了錯(cuò)誤和沖突。你分發(fā)這個(gè)DLL給所有開發(fā)團(tuán)隊(duì)。這是開發(fā)者真正共享的一部分代碼,所以盡量使他松散和一般化,因此包括了接口的定義而不是類的實(shí)現(xiàn)。

    The Infrastructure.Layout project is generated when you select the Create a Separate Module to Define the Layout for the Shell check box in the SCSF Wizard. If you don't select this box, then the layout of the user interface will then live directly in the shell project. The Infrastructure.Layout project will not be generated, and the shell form will contain a menu, status bar, toolbar, and two workspaces. If you do select the box, then the shell form will contain only one workspace that covers its entire surface. The Infrastructure.Layout DLL will contain a Smart Part (also known as a view) called the Layout View. This view will contain all the UI elements that the shell previously had and automatically place itself into the shell's workspace at startup time. You make this choice when you need several different shell form layouts for different configurations of the program. For example, suppose that client A wants its customer selection on the left side of the shell form, but client B wants its customer selection on the top of the shell form. The loose coupling mechanism of CAB allows you to create two or more separate Infrastructure.Layout modules and load one or another at runtime according to configuration files. This allows you to separate layout and program implementation, with a great increase in program flexibility. If, on the other hand, you are a corporate developer building a program solely for in-house use, you might not want to take the trouble of separating these concerns.

    LayOut Project,在向?qū)е羞x擇單獨(dú)生成才會(huì)有。否則,用戶接口的layout將和shell 項(xiàng)目在一起,shell form將包括僅有一個(gè)workspace。 LayoutDll包括一個(gè)Smart Part,被稱作Layout View。這個(gè)View包括所有的UI elements. 你可以有多個(gè)Layout,可以在運(yùn)行時(shí)加載其中的一個(gè)。

    本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶發(fā)布,不代表本站觀點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購買等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
    轉(zhuǎn)藏 分享 獻(xiàn)花(0

    0條評(píng)論

    發(fā)表

    請(qǐng)遵守用戶 評(píng)論公約

    類似文章 更多

    亚洲国产中文字幕在线观看| 丁香七月啪啪激情综合| 亚洲成人黄色一级大片| 国产日韩久久精品一区| 国产欧美日产久久婷婷| 婷婷一区二区三区四区| 日韩欧美黄色一级视频| 制服丝袜美腿美女一区二区| 国产精品蜜桃久久一区二区| 大香蕉伊人精品在线观看| 久久黄片免费播放大全| 日本高清视频在线观看不卡| 九九热这里只有精品视频| 日本少妇三级三级三级| 欧美色婷婷综合狠狠爱| 欧美日韩人妻中文一区二区| 欧美日韩三区在线观看| 国产中文另类天堂二区| 最好看的人妻中文字幕| 免费亚洲黄色在线观看| 色婷婷视频国产一区视频| 欧美自拍系列精品在线| 日韩精品中文字幕在线视频| 中文字幕精品一区二区年下载| 亚洲欧美日韩国产自拍| 最新日韩精品一推荐日韩精品| 俄罗斯胖女人性生活视频| 亚洲精品欧美精品一区三区| 激情丁香激情五月婷婷| 亚洲高清欧美中文字幕| 国产麻豆视频一二三区| 麻豆最新出品国产精品| 久久精品亚洲欧美日韩| 国产又色又粗又黄又爽| 欧美一区二区三区五月婷婷| 亚洲欧美日韩国产综合在线| 日本av一区二区不卡| 久久精品亚洲精品一区| 美女露小粉嫩91精品久久久| 色婷婷丁香激情五月天| 欧美日韩国产欧美日韩|