Question 70
You plan to create one provider Web Part and two consumer Web Parts.
You need to ensure that the consumer Web Parts can receive data from the provider Web Part.
You create an interface that contains the following code segment.
public interface Interface1
{
  string Parameter1 { get; set; }
}
What should you do next?
A. Implement Interface1 in the provider Web Part.
B. Implement IWebPartField in the provider Web Part.
C. Create a set accessor for Parameter1.
D. Create a second interface and use it to communicate with the provider Web Part.

解析:
 本题其实是上题的翻版,还是考你在哪个WebPart实现题干部分定义的Interface。
选项B. IwebPartField: 属于微软针对 Web 部件基础结构提供的一组标准连接接口中的一种(还有: IWebPartRow ,IWebPartTable等 ),此类标准连接接口,主要是为了使可连接WebPart的开发更具工业化特色(如同制定了汽车轮胎的标准接口,那么不管哪家工厂生产的轮胎,只要符合此标准,就可以通用到符合此标准的汽车上),因此可连接的 Web 部件可以完全可以由不同的开发人员或公司进行开发以便彼此进行通信。所以,选项B的IwebPartField接口就是用来实现WebPart连接的,而且的确也应该是在Provider Web Part中实现的。但对本题为什么是错的呢?因为本题已经在题干部分”个性化”定制了一个接口Interface1,而并没有采用“标准化接口”方案,所以在Provider端实现的就应该是个性化定制的接口Interface1。
  选项C说的是给Parameter1创建一个设置手段,
eg:
public System.String Parameter1
{
  get { return _ PARAMETER1; }
  set { _ PARAMETER1= value; }  //创建一个Set Accessor
}
 说的是参数属性的创建,显然与本题的WebPart部件连接无关。
选项D是建议你另创建一个Interface,有点多此一举的做法。
所以本题目正确选项应该是A

参考:
http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.webparts.iwebpartfield.aspx
http://msdn.microsoft.com/en-us/library/ms469765.aspx

Question 71
You create a Web Part named WP1.
You need to ensure that the name of the Web Part displays as Corporate in SharePoint.
What should you do?
A. Rename WP1.webpart as Corporate.webpart.
B. In WP1.webpart, change the Title property to Corporate.
C. In the constructor of WP1.cs, add the following line of code:
Page.Title="Corporate";
D. In the Elements.xml file, change the Name property of the <File> element to Corporate.

解析:
 本题意图通过代码设置Webpart的Title属性。此属性的设置值将会显示在Webpart的Title Bar位置。
选项A. Rename WP1.webpart as Corporate.webpart. 只是修改了Wepart文件的文件名。我们知道我们可以通过建立VS2010的Web 部件项目来创建 SharePoint 网站的 web 部件。 当您创建一个 Web 部件 项目时,Visual Studio 在项目中创建一个文件夹中并将添加几个文件到文件夹。 下面就是这几个文件:
  1. Elements.xml:包含在项目中的功能定义文件使用部署 web 部件的信息。
  2. .webpart 文件:提供 SharePoint 需要显示了您在 web 部件库中的 web 部件的信息。
  3. 代码文件:包含将控件添加到 web 部件,并生成在 web 部件中的自定义内容的方法。
 本选项就是设置的.webpart文件的文件名,它并不能影响Webpart在显示界面上的Title值。
选项B. 是本题的答案,通过设置Webpart控件的Title属性当然就是修改了Webpart的Title显示值。
选项C. In the constructor of WP1.cs, add the following line of code:
Page.Title="Corporate"; 本选项的操作修改的是Webpart所在页面的Title属性,而不是Webpart控件的Title属性。
选项D. In the Elements.xml file, change the Name property of the <File> element to Corporate. 参考选项A,Elements.xml文件是用于定义文件使用部署 web 部件的信息,也即它主要是控制WebPart的部署。而且关于Element.xml文件中的<File>元素,我还没有看到修改它的所谓Name属性的情形,通常都是修改它的Path,Url与Type属性,如果查看资料,你会发现,在此处它是没有什么Name属性的。

<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <Module Name="WP_Resources" Path="WP_Resources">
        <File Path="links.xml" Url="links.xml" Type="GhostableInLibrary" />
    </Module>
</Elements>
所以本题目正确选项应该是B

参考:
http://msdn.microsoft.com/en-us/library/ms227561.aspx
http://msdn.microsoft.com/zh-cn/library/microsoft.sharepoint.webpartpages.webpart.title(v=office.12).aspx
http://msdn.microsoft.com/en-us/library/ee231567.aspx

Question 72
You create a Web Part that contains the following logging code. (Line numbers are included for reference only.)
01 SPWeb web = SPContext.Current.Web;
02 try
03 {
04  
05 }
06 catch (Exception ex)
07 {
08  
09   System.Diagnostics.EventLog.WriteEntry("WebPart Name", ("Exception Information: " + ex.Message), EventLogEntryType.Error);
10 }
You discover that line 09 causes an error.  You need to resolve the error.
What should you do?
A. Run the code segment at line 09 inside a RunWithElevatedPrivileges delegate.
B. Add the following code at line 08:
if (web.CurrentUser.IsSiteAuditor == false)
C. Add the following code at line 08:
if (web.CurrentUser.IsSiteAdmin == false)
D. Change line 09 to the following code segment:
System.Diagnostics.EventLog.WriteEntry("WebPart Name", "Exception Information", EventLogEntryType.Error);

解析:
 本题的情景就是在你的代码中捕捉到异常,然后想把异常信息写入到EventLog中,结果出错。所以很明显,这是关于写入操作的权限问题,如果做了前面的Question59,你就能很快地确定选项A为本题的答案,即:通过RunWithElevatedPrivileges以”管理员账户身份”来完成写入操作。
 选项B. 是用来判断当前登录的用户是否是当前Site Collection的 auditor(审计者)。
选项C. 是用来判断当前登录的用户是否是当前Site Collection的 administrator(管理员)。这也解决不了问题,因为EventLog并不是归属于哪个Site Collection的,它必须要更高层次的管理员帐户才能有权写入操作。
选项D. 只是改变了写入内容,而并没提升写入的权限。
所以本题目正确选项应该是A

参考:
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsecurity.runwithelevatedprivileges.aspx
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spuser.issiteauditor.aspx
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spuser.issiteadmin.aspx

Sharepoint学习笔记—习题系列--70-573习题解析 -(Q70-Q72)的更多相关文章

  1. Sharepoint学习笔记—ECM系列—文档列表的Metedata Navigation与Key Filter功能的实现

    如果一个文档列表中存放了成百上千的文档,想要快速的找到你想要的还真不是件容易的事,Sharepoint提供了Metedata Navigation与Key Filter功能可以帮助我们快速的过滤和定位 ...

  2. Sharepoint学习笔记—ECM系列--文档集(Document Set)的实现

    文档集是 SharePoint Server 2010 中的一项新功能,它使组织能够管理单个可交付文档或工作产品(可包含多个文档或文件).文档集是特殊类型的文件夹,它合并了唯一的文档集属性以及文件夹和 ...

  3. Sharepoint学习笔记—习题系列--70-576习题解析 --索引目录

        Sharepoint学习笔记—习题系列--70-576习题解析  为便于查阅,这里整理并列出了70-576习题解析系列的所有问题,有些内容可能会在以后更新. 需要事先申明的是:     1. ...

  4. Sharepoint学习笔记—习题系列--70-573习题解析 --索引目录

                  Sharepoint学习笔记—习题系列--70-573习题解析 为便于查阅,这里整理并列出了我前面播客中的关于70-573习题解析系列的所有问题,有些内容可能会在以后更新, ...

  5. Deep Learning(深度学习)学习笔记整理系列之(五)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  6. Deep Learning(深度学习)学习笔记整理系列之(八)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  7. Deep Learning(深度学习)学习笔记整理系列之(七)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  8. Deep Learning(深度学习)学习笔记整理系列之(六)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  9. Deep Learning(深度学习)学习笔记整理系列之(四)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

  10. Deep Learning(深度学习)学习笔记整理系列之(三)

    Deep Learning(深度学习)学习笔记整理系列 zouxy09@qq.com http://blog.csdn.net/zouxy09 作者:Zouxy version 1.0 2013-04 ...

随机推荐

  1. 多个Storyboard的使用

    创建一个Storyboard工程 storyboard是在ios5中引入的新控件,能够更加清晰.简单的整合多个ViewController的关系,下面主要介绍一下怎么初建一个storyboard的工程 ...

  2. angularjs + seajs构建Web Form前端(二)

    回顾 上一篇讲解了引入bootstrap构建一个简单的登录页面,如何让angularjs自动启动并绑定视图,操作过程当中如何使用ui-bootstrap,继而完成简单功能后如何引入seajs后如何使n ...

  3. 2^x mod n = 1(欧拉定理,欧拉函数,快速幂乘)

    2^x mod n = 1 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tot ...

  4. 获得View的真实高度

    // 标题 RelativeLayout view = (RelativeLayout) getLayoutInflater().inflate( R.layout.webviewheader, nu ...

  5. MySQL单机load过高问题讨论

    有一个朋友问我: "hi,我想问下你们遇到单机load过高的情况 采取什么紧急措施啊?" 我问他是不是mysql db server? 他说是. 我给他如下建议: 1 先看下是不是 ...

  6. supervisor 安装 配置 及 使用

    supervisor是微软官方推荐的一个工具,传送门, 所以我们也使用这个工具来管理我们的asp.net core应用进程   服务器环境:ubuntu14.04 x64   安装  apt-get ...

  7. [Python] Symbol Review

    From:http://learnpythonthehardway.org/book/ex37.html 1. with X as Y: pass 1.1 yield 2. exec 2.1 name ...

  8. 2、Oracle Logminer性能测试

    Oracle Logminer性能测试 1 测试介绍 1.1 测试目的 通过模拟不同环境下LogMiner解析联机/归档日志文件运行情况,通过测试所获取的数据分析,通过对以下两点的验证来确定通过Log ...

  9. 你不一定知道的几个很有用的 Git 命令

    这里给大家分享一些很有用的 Git 命令,其中很多用法你可能都不知道,无论你是工作在团队环境中或在您的个人项目中,这些命令将对你帮助很大,让你可以更加高效的进行项目开发,更轻松愉快的工作和生活. 您可 ...

  10. LeetCode——Find Median from Data Stream

    Median is the middle value in an ordered integer list. If the size of the list is even, there is no ...