試験概要
この試験では、Visual Studio 2008 を使用して下記評価スキル表内で記載された知識と技術を評価します。
対応資格
この試験の対応資格は以下です。
MCTS: .NET Framework 3.5, Windows Presentation Foundation アプリケーション
オフィシャル マイクロソフト ラーニング プロダクト(OMLP)
現時点で、日本語版対応コースは、提供しておりません
TestPassPort 実践試験の MCTS 70-502(C#) は最も標準的な技術を正確的に書き入れ、認証した専門家と作者の出版した新製品だけを使います.
VUE/Prometric 試験番号: 70-502(C#)
試験の名称: TS: MS.NET Frmewrk3.5, Wndws Presentation Fndation App Dev
問題と解答: 88 Q&A
更新: 2009-08-18
70-502(C#): ダウンロード 70-502(C#) 試験 Software format Demo
2. You create a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application is named EnterpriseApplication.exe.
You add the WindowSize parameter and the WindowPosition parameter to the Settings.settings file by
using the designer at the User Scope Level. The dimensions and position of the window are read from the
user configuration file.
The application must retain the original window size and position for each user who executes the
application.
You need to ensure that the following requirements are met:
The window dimensions for each user are saved in the user configuration file.
The user settings persist when a user exits the application.
Which configuration setting should you use?
A. private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e){
Settings.Default.WindowPosition = new Point (this.Left, this.Top);
Settings.Default.WindowSize = new Size (this.Width, this.Height);
Settings.Default.Save();
}
B. private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e){
RegistryKey appKey = Registry.CurrentUser.CreateSubKey(”Software\\EnterpriseApplication”);
RegistryKey settingsKey = appKey.CreateSubKey(”WindowSettings”);
RegistryKey windowPositionKey = settingsKey.CreateSubKey(”WindowPosition”);
RegistryKey windowSizeKey = settingsKey.CreateSubKey(”WindowSize”);
windowPositionKey.SetValue(”X”, this.Left);
windowPositionKey.SetValue(”Y”, this.Top);
windowSizeKey.SetValue(”Width”, this.Width);
windowSizeKey.SetValue(”Height”, this.Height);
}
C. private void OnClosing(object sender, System.ComponentModel.CancelEventArgs e){
| English | Chinese | Japan | Korean | - 4 - Test Information Co., Ltd. All rights reserved.
XmlDocument doc = new XmlDocument();
doc.Load(”EnterpriseApplication.exe.config”);
XmlNode nodePosition = doc.SelectSingleNode(”//setting[@name=\'WindowPosition\']“);
nodePosition.ChildNodes[0].InnerText = String.Format(”{0},{1}”, this.Left, this.Top);
XmlNode nodeSize = doc.SelectSingleNode(”//setting[@name=\'WindowSize\']“);
nodeSize.ChildNodes[0].InnerText = String.Format(”{0},{1}”, this.Width, this.Height);
doc.Save(”UserConfigDistractor2.exe.config”);
}
D. private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e){
StreamWriter sw = new StreamWriter(”EnterpriseApplication.exe.config”, true);
sw.WriteLine(”<EnterpriseApplication.Properties.Settings>”);
sw.WriteLine(”<setting name=\”WindowSize\” serializeAs=\”String\”>”);
sw.WriteLine(String.Format(”<value>{0},{1}</value>”, this.Width, this.Height));
sw.WriteLine(”</setting>”);
sw.WriteLine(”<setting name=\”WindowPosition\” serializeAs=\”String\”>”);
sw.WriteLine(String.Format(”<value>{0},{1}</value>”, this.Left,this.Top));
sw.WriteLine(”</setting>”);
sw.WriteLine(”</UserConfigProblem.Properties.Settings>”);
sw.Close();
}
Answer: A