70-502CSharp Exam
TS: MS.NET Frmewrk3.5, Wndws Presentation Fndation App Dev
- Exam Number/Code : 70-502CSharp
- Exam Name : TS: MS.NET Frmewrk3.5, Wndws Presentation Fndation App Dev
- Questions and Answers : 177 Q&As
- Update Time: 2011-05-04
- Price:
$ 125.00$ 100.00
Free 70-502CSharp Dumps Download
Exam4dumps offers free 70-502CSharp dumps,70-502CSharp Practice exam,70-502CSharp exam questions for TS certification(Microsoft Certified Network Associate). You can check out the question quality and usability of our 70-502CSharp practice exam before you decide to buy it.Before you purchase our 70-502CSharp Q&A,you can click the link below to download the latest 70-502CSharp pdf dumps.
Exam : Microsoft 70-502(C#)
Title : TS: Microsoft .NET Framework 3.5 - Windows Presentation Foundation
1. You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 5.
The application defines a BrowserWindow class. Each instance of the BrowserWindow class allows the user to browse a Web site in a separate window. When a new browser window is opened, the user is redirected to a predefined URL.
You write the following code segment.
01 private void OpenNewWindow(object sender, RoutedEventArgs e)
02 {
03 Thread newWindowThread = new Thread(new
ThreadStart(NewThreadProc));
04
05 newWindowThread.Start();
06 }
07 private void NewThreadProc()
08 {
09
10 }
You need to ensure that the following requirements are met:
The main window of the application is not blocked when an additional browser window is created.
The application completes execution when the main window of the application is closed.
What should you do?
A. Insert the following code segment at line 04.
newWindowThread.SetApartmentState(ApartmentState.STA);
newWindowThread.IsBackground = true;
Insert the following code segment at line 09.
BrowserWindow newWindow = new BrowserWindow();
newWindow.Show();
Application app = new Application();
app.Run(newWindow);
B. Insert the following code segment at line 04.
newWindowThread.IsBackground = true;
Insert the following code segment at line 09.
newWindowThread.SetApartmentState(ApartmentState.STA);
BrowserWindow newWindow = new BrowserWindow();
newWindow.Show();
Application app = new Application();
app.Run(newWindow);
C. Insert the following code segment at line 04.
newWindowThread.SetApartmentState(ApartmentState.STA);
newWindowThread.IsBackground = false;
Insert the following code segment at line 09.
BrowserWindow newWindow = new BrowserWindow();
System.Windows.Threading.Dispatcher.Run();
newWindow.Show();
D. Insert the following code segment at line 04.
newWindowThread.SetApartmentState(ApartmentState.STA);
newWindowThread.IsBackground = true;
Insert the following code segment at line 09.
BrowserWindow newWindow = new BrowserWindow();
newWindow.Show();
System.Windows.Threading.Dispatcher.Run();
Answer: D
2. You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
The application uses several asynchronous operations to calculate data that is displayed to the user. An operation named tommorowsWeather performs calculations that will be used by other operations.
You need to ensure that tommorowsWeather runs at the highest possible priority.
Which code segment should you use?
A. tomorrowsWeather.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Normal,
new OneArgDelegate(UpdateUserInterface), weather);
B. tomorrowsWeather.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.DataBind,
new OneArgDelegate(UpdateUserInterface), weather);
C. tomorrowsWeather.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send,
new OneArgDelegate(UpdateUserInterface), weather);
D. tomorrowsWeather.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render,
new OneArgDelegate(UpdateUserInterface), weather);
Answer: C
3. You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.
You create a window for the application.
You need to ensure that the following requirements are met:
An array of strings is displayed by using a ListBox control in a two-column format.
The data in the ListBox control flows from left to right and from top to bottom.
What should you do?
A. Use a ListBox control defined in the following manner.
<ListBox Name="myList">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<UniformGrid Columns="2"/>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
Use the following C# code to associate the array of strings to the ListBox control.
myList.ItemsSource = arrayOfString;
B. Use a ListBox control defined in the following manner.
<ListBox Name="myList">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
Use the following C# code to associate the array of strings to the ListBox control.
myList.ItemsSource = arrayOfString;
C. Use a ListBox control defined in the following manner.
<ListBox Name="myList">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
Use the following C# code to associate the array of strings to the ListBox control.
myListView.ItemsSource = arrayOfString;
D. Use a ListBox control defined in the following manner.
<ListBox Name="myList">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
Use the following C# code to associate the array of strings to the ListBox control.
myList.ItemsSource = arrayOfString;
Answer: A
4. 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){
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
5. You are creating a Windows Presentation Foundation application by using Microsoft .NET Framework 3.5.
You add a CommandBinding element to the Window element. The command has a keyboard gesture CTRL+H. The Window contains the following MenuItem control.
<MenuItem Header="Highlight Content" Command="local:CustomCommands.Highlight" />
You need to ensure that the MenuItem control is disabled and the command is not executable when the focus shifts to a TextBox control that does not contain any text.
What should you do?
A. Set the IsEnabled property for the MenuItem control in the GotFocus event handler for the TextBox controls.
B. Set the CanExecute property of the command to Highlight_CanExecute.
Add the following method to the code-behind file for the window.
private void Highlight_CanExecute(object sender, CanExecuteEventArgs e) {
TextBox txtBox = sender as TextBox;
e.CanExecute = (txtBox.Text.Length > 0);
}
C. Set the CanExecute property of the command to Highlight_CanExecute.
Add the following method to the code behind file for the window.
private void Highlight_CanExecute(object sender, CanExecuteEventArgs e) {
TextBox txtBox = e.Source as TextBox;
e.CanExecute = (txtBox.Text.Length > 0);
}
D. Set the CanExecute property of the command to Highlight_CanExecute.
Add the following method to the code behind file for the window.
private void Highlight_CanExecute(object sender, CanExecuteEventArgs e) {
MenuItem menu = e.Source as MenuItem;
TextBox txtBox = menu.CommandTarget as TextBox;
Menu.IsEnabled = (txtBox.Text.Length > 0);
}
Answer: C
Free download:Free 70-502CSharp dumps
Download 70-502CSharp Exam Testing Engine
Exam4dumps 70-502CSharp Exam Description
70-502CSharp exam training is available in various formats to best suit your needs and learning style from Exam4dumps. Whether you are a hands-on tactile learner, visually or even a textbook training veteran, we has the 70-502CSharp resources that will guarantee you to pass your 70-502CSharp practice exam at the first time!
Guarantee to Pass Your 70-502CSharp Exam
We provide the latest high quality 70-502CSharp practice exam for the customers,we guarantee your success at the first attempt with only our 70-502CSharp exam questions, if somehow you do not pass the exam at the first time, we will not only arrange FULL REFUND for you, but also provide you another exam of your claim, ABSOLUTELY FREE!
The Tenet Of Exam4dumps
Our on-site online training experts create all of the Microsoft 70-502CSharp exam products available through Actual-Exams. Our main goal is that you get more kownleage with less money.You will find our price is very cheap.
After-sales Service
Once you purchase our products,we will offer you the best service.After you purchase our product, we will offer free update in time for 90 days.Whatever you have any questions,we will help you solve it. And in 3 weeks we will offer you free updates,so please pay attention our site at all times.
Acquiring Microsoft TS certifications are becoming a huge task in the field of I.T. More over these exams like 70-502CSharp exam are now continuously updating and accepting this challenge is itself a task. This 70-502CSharp practice test is an important part of Microsoft certifications and at TS braindumps we have the resources to prepare you for this. The 70-502CSharp exam is essential and core part of Microsoft certifications and once you clear the exam you will be able to solve the real time problems yourself.Wamt to take advantage of the Real 70-502CSharp Value Pack and save time and money while developing your skills to pass your 'Microsoft Certified Network Associate (TS) Exam'? Let Exam4dumps help you climb that ladder of success and pass your 70-502CSharp now!


