Blog Home  Home Feed your aggregator (RSS 2.0)  
What did you learn today? - Thursday, February 23, 2006
Phil Denoncourt's Technology Rants
 
 Thursday, February 23, 2006

UPGRADE: MCAD Skills to MCPD Web Developer by Using the Microsoft .NET Framework

Add and configure Web server controls.

  • Add Web server controls to a Web Form.
  • Configure the properties of Web server controls programmatically.
  • Configure Web server control properties by using the Microsoft Visual Studio Property Editor.
  • Specify whether events of a control cause a Web Form to post to the server.
  • Configure a control to receive postback events.
  • Access controls in Web Forms pages when working with naming containers and child controls.
  • Create HTML server controls in the designer.
  • Set HTML server control properties programmatically.
  • Use HTML server controls to programmatically access HTML tags.
  • Create HTML controls as elements in an HTML document.
  • Use the AdRotator Web server control to manage banners and pop-up windows.
  • Use the Button Web server control to send a command to the server when a button is clicked.
  • Display a calendar on a Web page by using the Calendar Web server control.
  • Implement the CheckBox Web server control.
  • Implement the FileUpload Web server control.
  • Create and manipulate links on a Web Form by using the HyperLink Web server control.
  • Display an image on a Web Form by using the Image Web server control.
  • Implement a button on a Web Form by using the ImageButton Web server control.
  • Define hotspot regions within an image by using the ImageMap Web server control.
  • Use the Label Web server control to display customized text on a Web page.
  • Display a hyperlink style button on a Web Form by using the LinkButton Web server control.
  • Display lists of information by using controls that derive from the ListControl class.
  • Create a Web Form with static text by using the Literal Web server control.
  • Implement pagination for controls on a page by using the Pager Web server control.
  • Use the Panel Web server control to arrange controls in groups on a page.
  • Create a container for a group of View controls by using the MultiView Web server control.
  • Use the View Web server control to create a Web application.
  • Create a mutually exclusive set of choices by using the RadioButton Web server control.
  • Construct a table by using the Table, TableRow, and TableCell Web server controls.
  • Enable users to type information into a Web Form by using the TextBox Web server control.
  • Create a wizard by using the Wizard Web server control to collect data through multiple steps of a process.
  • Use the XML Web server control to create XML data at the location of the control.
  • Customize the appearance of Web server controls by using Web control templates.
  • Programmatically edit settings in a Web site's configuration file.
  • Dynamically add Web server controls to a Web Forms page.

The first three bullets shouldn't be problematic.  The next two are about setting the AutoPostback property of web controls. 

To access controls within a naming container, use the FindControl method.  Remember that FindControl only finds controls within its own Naming Container.

"Create HTML server controls in the designer." and "Set HTML server control properties programmatically" shouldn't present new challenges.

To create HTML controls as elements in the HTML document, you can add the RunAt=Server attribute to existing HTML elements, or you can add elements at runtime by creating an HtmlGenericControl and adding it to the controls collection.

The AdRotator component hasn't changed much.  It is now bindable to a database.  As I recall, you used to have to create an XML file for it to use.  Doug Seven has a article on the AdRotator component (based on an older version of the framework)

The Button control has a few minor changes.  It has an OnClientClick property.  You put in javascript code that will execute when the user clicks the button.  There is also a UseSubmitBehavior, which if set, turns the button into an HTML submit button.  In addition, there is a PostBackUrl property which states which page should be loaded when a button causes a postback.  Dino Esposito has a writeup on some of the complications in using this property.  Buttons also govern a new feature called ValidationGroups implemented using the ValidationGroup property.  Peter Blum has a writeup explaining the new feature.

Mike Pope found what was new with the Calendar control (And most others as well).

No changes on the CheckBox control except it can be a part of a ValidationGroup. 

The FileUpload control is new, but it is functionally identical to the HtmlInputFile control.  Anand Narayanaswany has a quick tutorial on using the control.

The Hyperlink control hasn't changed.

The image control also hasn't changed significantly except the property that Mike points out, GenerateEmptyAlternativeText.

The ImageButton has the same changes as the button control.

ImageMap control is brand new.  You define hotspots over a image in different shapes (Circle, Rectange, Polygon).  With each hotspot, you specify a PostBackValue.  That is the value that is sent back to the page if you said that postbacks should occur.  The other option is to have it navigate to a specific URL when the hotspot is clicked.

The label control hasn't changed much.  Support for skinning is about it.

LinkButton also has the same new properties as the button control.

There are four controls that derive from ListControl: CheckBoxList, DropDownList, ListBox, and RadioButtonList.  They all support the new data binding model.  There is a property call AppendDataBoundItems that allows you to add bound items below items that you've added manually.  That seems to be about it.

The Literal control has a mode property, allowing you to state how to treat the literal: Encode (The contents are HTML-Encoded), PassThrough (The contents are not touched), or Transform (Remove unsupported elements for WML or cHTML renderings)

The Pager control was dropped from the final release.

The Panel control has some improvements.  There is a ScrollBars property that allows you to specify whether or not content is scrolled within the panel.  There is a DefaultButton property that specifies which button is depressed when <Enter> is pressed within the panel.  There is a GroupingText property which is displayed as a title in the panel.

The MultiView control is a nice new control.  It's purpose is control a collection of View controls, of which only one can be visible at a time.  Jason N. Gaylord has a tutorial on ASP Alliance.

Remember that Views can only be used within a MultiView control.

The Radiobutton control hasn't changed.  Join a Radiobutton to a group using the GroupName property.  It supports validation groups.

The Table, TableRow, and TableCell controls don't appear to have changed.

The Textbox has support for Autocomplete, that appears to be all I see as changed.

The wizard is a templated control that allows you to create a wizard without having to worry about the plumbing of the previous/next/finished buttons.  Dino Esposito has a writeup at MSDN on the control.

The XML Control hasn't changed.  It's used to bring XML back to the client which can then be transformed into presentable data.

Web control templates?  Maybe they mean skinning.  Thiru Thangarathinam has a writeup at 15seconds.com about skinning.  To me it seems they took CSS to the next level.

You would modify the web.config file using the ASP.NET Configuration API.  Note that the account must have write access to successfully update the config.

To programmatically add controls to a webpage, just create a new object, add it to the page's controls collection.  Scott Mitchell has a quick overview of how to do this.

Next up->Web Application Settings

Thursday, February 23, 2006 5:41:57 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
 Tuesday, February 21, 2006

March 2nd, I'll be in Boston at the Beantown Dot Net user's group giving a talk on XML Serialization.

XML Serialization - XML Serialization is the process of transforming a complex object to and from XML. This is made straightforward with the .NET framework. We'll take a look out how to serialize a simple object and some of the attributes used to control the output. Then we'll take a look at some of the more advanced features like capturing processing errors, overrides and unknown elements. Finally we'll take complete control of the serialization process using the new features of the 2.0 Framework. Be the envy of all your coworkers by mastering XML serialization.

Phil Denoncourt is a .NET consultant, who over the past 4 years has developed a wide range of .NET applications and has over 20 years experience writing software. He is the leader of the New England C# User Group and has acquired the MCSD, MCDBA, MCSE, MCAD, MCSA and MCP+SB certifications. When not coding, or spending time with his wife and 5 children, Phil is an avid fan of the Boston Red Sox and New England Patriots.

Tomorrow I'll get started on the study guide for 70-551 - Web Applications.

Tuesday, February 21, 2006 1:06:44 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Speaking Engagements  | 
 Saturday, February 18, 2006

Evaluate the technical feasibility of an application design concept.

  • Evaluate the proof of concept.
  • Recommend the best technologies for the features and goals of the application.
  • Weigh implementation considerations.
  • Investigate existing solutions for similar business problems.

Create a proof-of-concept prototype.

  • Evaluate the risks associated with the proposed technology or implementation.
  • Validate that the proposed technology can be used in the application.
  • Demonstrate to stakeholders that the proposed solution will address their needs.

Evaluate the technical specifications for an application to ensure that the business requirements are met.

  • Translate the functional specification into developer terminology, such as pseudo code and UML diagrams.
  • Suggest component type and layer.

Evaluate the logical design of an application.

  • Evaluate the logical design for performance.
  • Evaluate the logical design for maintainability.
  • Evaluate the logical design for extensibility.
  • Evaluate the logical design for scalability.
  • Evaluate the logical design for security.
  • Evaluate the logical design against use cases.
  • Evaluate the logical design for recoverability.
  • Evaluate the logical design for data integrity.

Evaluate the physical design of an application. Considerations include the design of the project structure, the number of files, the number of assemblies, and the location of these resources on the server.

  • Evaluate the physical design for performance.
  • Evaluate the physical design for maintainability.
  • Evaluate how the physical location of files affects the extensibility of the application.
  • Evaluate the physical design for scalability.
  • Evaluate the physical design for security.
  • Evaluate the physical design for recoverability.
  • Evaluate the physical design for data integrity.

Choose an appropriate layout for the visual interface.

  • Decide the content flow within the application.
  • Evaluate user navigation needs.
  • Identify the goal of the UI.
  • Ensure the congruency and consistency of the user experience throughout the application.
  • Choose techniques to control the layout.

Evaluate a strategy for implementing a common layout throughout the UI.

  • Suggest an applicable UI standard based on the application specification. Considerations include MDI, SDI, control grouping, and so on.

Choose an appropriate control based on design specifications.

  • Evaluate the type of data that must be captured or displayed.
  • Evaluate available controls. Considerations include standard .NET Framework controls and custom, internally developed, and third-party controls.
  • Evaluate the manner in which available controls are implemented in previous and ongoing projects or applications.
  • Evaluate the user demographic.
  • Evaluate the user environment.

Choose an appropriate data validation method at the UI layer.

  • Choose a validation method based on the data type provided.
  • Decide how to report the feedback. Considerations include callbacks, exceptions, and writing to an event log.
  • Identify the source of invalid data.
  • Identify the cause of an invalid entry.
  • Evaluate whether invalid data can be prevented.
  • Evaluate whether an exception must be thrown.
  • Evaluate whether an exception must be logged.
  • Evaluate whether visual feedback, such as a message box or color, is required.

Choose appropriate user assistance and application status feedback techniques.

  • Design a user assistance mechanism.
  • Choose an appropriate application status feedback technique based on available control types.
  • Choose an appropriate application status feedback technique to support accessibility.
  • Design an application status feedback mechanism.

Establish the required characteristics of a component.

  • Decide when to create a single component or multiple components.
  • Decide in which tier of the application a component should be located.
  • Decide which type of object to build.

Create the high-level design of a component.

  • Establish the life cycle of a component.
  • Decide whether to use established design patterns for the component.
  • Decide whether to create a prototype for the component.
  • Document the design of a component by using pseudo code, class diagrams, sequence diagrams, activity diagrams, and state diagrams.
  • Evaluate tradeoff decisions. Considerations include security vs. performance, performance vs. maintainability, and so on.

Develop the public API of a component.

  • Decide the types of clients that can consume a component.
  • Establish the required component interfaces.
  • Decide whether to require constructor input.

Develop the features of a component.

  • Decide whether existing functionality can be implemented or inherited.
  • Decide how to handle unmanaged and managed resources.
  • Decide which extensibility features are required.
  • Decide whether a component must be multithreaded.
  • Decide which functions to implement in the base class, abstract class, or sealed class.

Develop an exception handling mechanism.

  • Decide when it is appropriate to raise an exception.
  • Decide how a component will handle exceptions. Considerations include catching and throwing a new exception; catching, wrapping, and throwing the wrapped exception; catching and terminating, and so on.

Develop the data access and data handling features of a component.

  • Analyze data relationships.
  • Analyze the data handling requirements of a component.

Develop a component to include profiling requirements.

  • Identify potential issues, such as resource leaks and performance gaps, by profiling a component.
  • Decide when to stop profiling on a component.
  • Decide whether to redesign a component after analyzing the profiling results.

Consume a reusable software component.

  • Identify a reusable software component from available components to meet the requirements.
  • Identify whether the reusable software component needs to be extended.
  • Identify whether the reusable software component needs to be wrapped.
  • Identify whether any existing functionality needs to be hidden.
  • Test the identified component based on the requirements.

Choose an appropriate exception handling mechanism.

  • Evaluate the current exception handling mechanism.
  • Design a new exception handling technique.

Choose an appropriate implementation approach for the application design logic.

  • Choose an appropriate data storage mechanism.
  • Choose an appropriate data flow structure.
  • Choose an appropriate decision flow structure.

Choose an appropriate event logging method for the application.

  • Decide whether to log data. Considerations include policies, security, requirements, and debugging.
  • Choose a storage mechanism for logged events. For example, database, flat file, event log, or XML file.
  • Choose a systemwide event logging method. For example, centralized logging, distributed logging, and so on.
  • Decide logging levels based upon severity and priority.

Evaluate the application configuration architecture.

  • Decide which configuration attributes to store.
  • Choose the physical storage location for the configuration attributes.
  • Decide in which format to store the configuration attributes.

Perform a code review.

Evaluate the testing strategy.

  • Create the unit testing strategy.
  • Evaluate the integration testing strategy.
  • Evaluate the stress testing strategy.
  • Evaluate the performance testing strategy.
  • Evaluate the test environment specification.

Design a unit test.

  • Describe the testing scenarios.
  • Decide coverage requirements.
  • Evaluate when to use boundary condition testing.
  • Decide the type of assertion tests to conduct.

Perform integration testing.

  • Determine if the component works as intended in the target environment.
  • Identify component interactions and dependencies.
  • Verify results.

Resolve a bug.

  • Investigate a reported bug.
  • Reproduce a bug.
  • Evaluate the impact of the bug and the associated cost and timeline for fixing the bug.
  • Fix a bug.

Evaluate the performance of an application based on the performance analysis strategy.

  • Identify performance spikes.
  • Analyze performance trends.
  • Track logon times.

Analyze the data received when monitoring an application.

  • Monitor and analyze resource usage.
  • Monitor and analyze security aspects.
  • Track bugs that result from customer activity.

Evaluate the deployment plan.

  • Identify component-level deployment dependencies.
  • Identify scripting requirements for deployment. Considerations include database scripting.
  • Evaluate available deployment methods.

Validate the production configuration environment.

  • Verify networking settings
  • Verify the deployment environment.
  • Verify the deployment environment.

This is nice.  If you can do all this, you should be able to call yourself a developer.  There's no amount of studying that can help you.  These bullet items are seeing if you can solve a problem using Microsoft technlogies and juggle different needs of your customers.  It will be interesting to see how they can test for this using a series of multiple choice questions.

In order to cover all of this material sufficiently, I'd have to write a book.  Also, I'm about to take the test in 2 hours, so I need to start reviewing the preivous material.  After I take the test, I suspect I'll no longer be able to publicly comment on this test.

 

Saturday, February 18, 2006 12:24:05 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
Configure the installation of a Windows Forms application by using ClickOnce technology.
  • Install a Windows Forms application on a client computer by using ClickOnce deployment.
  • Install a Windows Forms application from a server by using ClickOnce deployment.
  • Configure the required permissions of an application by using ClickOnce deployment.

Thiru Thangarathinam has an article at 15seconds that goes over the basics.  There is an FAQ on windowsforms.net about clickonce that also has some good info.  Michele Lerous Bustamante has a category on her blog about Clickonce.

Clickonce can also produce setup files that can be installed from a network share or CD.

Understand that in order to install a WinForm application from a server that uses Clickonce, you simply navigate to a URL that the application is hosted.  Because the user is downloading executable content, IE will warn them.

The  permissions can be set in the  project properties dialog.  Check the "Enable Clickonce Security Settings".  You state whether the application needs to run with Full Trust or Partial Trust.  With Partial Trust, you specify which zone your application will run from and the permissions are shown.  You can choose to request (include) or not a specific permission.  Also, there is a calculate permissions button.

Next up-> Envisioning and Designing an Application

Saturday, February 18, 2006 12:08:35 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
Manage a background process by using the BackgroundWorker component.
  • Run a background process by using the BackgroundWorker component.
  • Announce the completion of a background process by using the BackgroundWorker component.
  • Cancel a background process by using the BackgroundWorker component.
  • Report the progress of a background process by using the BackgroundWorker component.
  • Request the status of a background process by using the BackgroundWorker component.

The BackgroundWorker component is intended to make multi threading easier.  Ben Lovell has a good post that explains how to use it.

The code that will run in the background is placed in the DoWork event.  Remember that it is operating in a different thread than the UI, so if you want to touch any of the UI, you need to use BeginInvoke or Invoke.

To annouce the completion of a background process, you let the DoWork event finish.  That will fire the RunWorkerCompleted event.

To cancel a background process, you call the CancelAsync method.  In the DoWork event, you should constantly be checking the CancellationPending property, it doesn't automatically cancel itself.

To report progress, call the ReportProgress method, while in the DoWork event.

There's no obvious way to "request" the status of a background process.  There is a ProgressChanged event that you can hook into.

Next up-> Clickonce

Saturday, February 18, 2006 11:44:17 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 

Create, configure, and customize user assistance controls and components.

  • Configure the PropertyGrid component.
  • Configure the ProgressBar control to indicate progress graphically.
  • Display status information by using the StatusStrip control.
  • Configure the ToolTip component.
  • Configure the ErrorProvider component.
  • Configure the HelpProvider component.
  • Play system sounds and audio files by using the SoundPlayer.
  • Configure the Timer component to raise an event at regular intervals.
  • Enable scrolling by using the HScrollBar and VScrollBar controls.

The PropertyGrid component hasn't changed since 1.1.  Set the SelectedObject or SelectedObjects property and it will display all public settable properties.  I've found it to be a very useful, but underused component.

The ProgressBar control hasn't changed either.  Set the bounds by setting the Minimum and Maximum properties.  Indicate progress by setting the value property or calling the Increment method.

StatusStrip is a completely new control.  It derives from ToolStrip, so it can use all the ToolStrip controls.  It anchors itself to the bottom of your form.

The ToolTip component hasn't changed.  Drag it onto a form.  You only need one per form.  You can either enter tooltip text to all your controls at design time, or use the SetToolTip method to set the text.

The ErrorProvider component also hasn't changed.  When an error condition occurs, call the SetError method.  Remember to call the Clear method when the error no longer exists.

No change in the HelpProvider component, also.  Drag that component onto a form.  You'll see that three properties get added to the design of all controls on the form.  HelpString is the string that will be displayed when the user selects the control using the Help Button.  HelpNavigator specifies what elements of the help system will be displayed when the user asks for help.  HelpKeyword is the help topic that will be shown when the user asks for help.

The SoundPlayer control which existed during the betas, was dropped according to Kevin McNeish.

The Timer component hasn't changed from 1.1.  It fires an event at regular intervals.  Remember that the events are executed on the UI thread.

The HScrollBar and VScrollBar haven't changed either.  They work very similar(programming wise) to the ProgressBar, but the user can move the slider.  (There also isn't an Increment method).

Next up->Async Programming

Saturday, February 18, 2006 2:30:46 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 

Read, write, and validate XML by using the XmlReader class and the XmlWriter class.

  • Read XML data by using the XmlReader class.
  • Read all XML element and attribute content.
  • Read specific element and attribute content.
  • Read XML data by using the XmlTextReader class.
  • Read node trees by using the XmlNodeReader class.
  • Validate XML data by using the XmlValidatingReader class.
  • Write XML data by using the XmlWriter class.

MSDN has an page on the new stuff as afar as XML is concerned.

The XmlReader provides readonly/forwardonly access to Xml Data.  To create an implementation of the XmlReader (XmlTextReader, XmlNodeReader, XmlValidatingReader), call the Create method.  The big change is that you can associate a Schema with a XmlReader, rather than having to fake it with XmlValidatingReader.

To read all the XML content, you can use the ReadInnerXml or ReadOuterXml methods.  To get a specific element, you call MoveToElement, and then read the content by using .Name or .Value properties.  To get a specific attribute, you would call either MoveToFirstAttribute or MoveToNextAttribute.

The XmlTextReader is a reader that enforces the rules of well-formed XML.  An XmlException is thrown when it encounters bad XML. 

The XmlNodeReader is a reader that works off an XmlDocument.  Functionally works the same as XmlReader.

The XmlValidatingReader is a reader that makes sure the XML conforms to known schemas contained in the Schemas collection.  This is now obsolete because the XmlReader now has this built in.

The XmlWriter contains all the methods necessary to write XML.  WriteStartElement, WriteEndElement, WriteStartAttribute, WriteEndAttribute, WriteCData, WriteComment....

Next up-> The rest of WinForm Controls

Saturday, February 18, 2006 12:22:46 AM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
 Friday, February 17, 2006

Manage connections and transactions.

  • Configure a connection to a database by using the Connection Wizard.
  • Configure a connection to a database by using Server Explorer.
  • Configure a connection to a database by using the Connection class.
  • Connect to a database by using specific database Connection objects.
  • Enumerate through instances of Microsoft SQL Server.
  • Open an ADO.NET connection to a database.
  • Close an ADO.NET connection to a database by using the Close method of the Connection object.
  • Protect access to data source connection details.
  • Create a connection designed for reuse in a connection pool.
  • Control a connection pool by configuring ConnectionString values based on database type.
  • Use the Connection events to detect database information.
  • Handle exceptions when connecting to a database.
  • Perform transactions by using the Transaction object.

I've never been one to make use of a lot of wizards.  I was not able to find a "Connection Wizard".  I was able to find the "Data Source Configuration Wizard".  Not sure if that's what they mean.  In the Data Source connection wizard, if you specify that you want a Database data source, you are then prompted to select a connection.  On that screen you can push the New Connection button, which brings up a Choose Data Source dialog.  I'm not sure I'd call it a wizard.  Again, if anyone finds the "Connection Wizard", let me know where it is.

Configuring a connection in the Server Explorer is as easy as right clicking on the Data Connections node, and selecting add new connection.

There are a few objects that have a Connection property, but there is no Connection class.  There are classes that implement IDbConnection, but strictly speaking, (unless we talking about sharepoint) there is no Connection class.  However, if you have a class that implements IDbConnection (SqlConnection, OleDbConnection...), you configure it using the ConnectionString property.

To connect to a database, you instatiate a SqlConnection instance, set the Connectionstring, and call the Open method.  There is now a SqlConnectionStringBuilder class to help you build a connection string.

To enumerate through SQL Instances, use the SqlDataSourceEnumerator as explained by Sushil on his blog.

To Close an open connection to a database, use the Close method on the Connection object.  You can also call Dispose.  This isn't on topic, but while I was looking around, I noticed they added a ClearPool method to the SqlConnection object.  Nice!

To protect Datasource information, you're supposed to put the ConnectionStrings in the ConnectionStrings section of the app.config.  Then you're supposed to encrypt it.  What's fustrating is that there are dozens of examples of how to do this for ASP.NET.  Near as I can figure, it looks like you would, during installation with an installer class, get a reference to the SectionInformation and call the ProtectSection method.

To create a connection that will stay in a pool, make sure your connections are connecting to the database with the same login.  Reportedly having minor differences in the connection string will cause it not to pool. 

There is information about controlling Connection Pooling on MSDN.

There are two events worth listening to on a SqlConnection.  InfoMessage (fired when warnings or informational messages are returned by SQL Server), and StateChanged (fired when the state of the connection has changed).

To handle exceptions when connecting to a database, catch SqlException (if SQL rejected the connection), or InvalidOperationException (The connection was already opened, or you haven't given the connection object enough info.)

To Begin a transaction on an open connection, call the BeginTransaction method on the SqlConnection object.  That returns a transaction object that you control the Commit or Rollback with.  There is a new locking level, snapshot isolation which bears understanding.

There is also a new Systems.Transaction namespace.  This is used for distributed transactions.  John Papa has a writeup on MSDN covering the feature.

Next up-> XML Reader/Writer

Friday, February 17, 2006 10:09:28 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 

Implement data-bound controls.

  • Use the DataGridView control to display and update the tabular data contained in a data source.
  • Use a simple data-bound control to display a single data element on a Windows Form.
  • Implement complex data binding to integrate data from multiple sources.
  • Navigate forward and backward through records in a DataSet in Windows Forms.
  • Define a data source by using a DataConnector component.
  • Create data forms by using the Data Form Wizard.

There's a big section at WindowsForms.net on the DataGridView.  The DataGridView is the successor to the DataGrid.  They added more cell types: Image, Combobox, Link, Button.  (They only had Textbox and Checkbox in 1.1).  You can place more than one control in a cell.  There are now events associated with the cell itself, instead of handling all the events on the datagrid control.  The CellFormatting event allows you to control the look of specific cells.

The data binding subsystem has undergone a major overhaul.  As in 1.1, there is a different binding system for WinForms than WebForms.  Again there is a section at WindowsForms.Net dedicated to data binding, although not very comprehensive.  Dinesh Chandnani has a series of good blog entries on databinding.  The main component is called the BindingSource.  You can make your own components bindable by using the BindingList generic.

I'm not sure what they mean by complex data binding.  Handling some of the events in the BindingSource?

The BindingNavigator control is a Toolstrip control that hooks to a BindingSource that has the first,prev,next,last buttons already implemented.  You would use that to navigate through records in a dataset on a windows form.

The DataConnector component no longer exists.  It was renamed to BindingSource in earlier Whidbey releases.

Alright, I give up.  My wife tells me that I stink at looking for things.  My keys could be right in front of me and I won't see them.  With that disclaimer in mind, I've been looking 15 minutes for the "Data Form Wizard".  It clearly existed in 1.1.  Where is it?  If anyone knows where it is, let me know.

Next up->Connections and Transactions

Friday, February 17, 2006 3:37:24 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
 Thursday, February 16, 2006
Create and configure menus.
  • Create and configure a MenuStrip component on a Windows Form.
  • Change the displayed menu structure programmatically.
  • Create and configure the ContextMenuStrip component on a Windows Form.

There is a good article on DevX about the xStrip controlsMSDN has a good technology overview as well.  The Toolbar, menu and status bar render in a look (by default) that is similiar to Office xp.  Understand that the Menu, Toolbar and StatusBar all derive from a common base, ToolStrip.    ToolStrip is a container for ToolStripItem controls.  The ToolStrip uses Renderers to control its display.  Look at the RenderMode property for more information.

Next up-> Data binding

Thursday, February 16, 2006 9:51:45 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
 Wednesday, February 15, 2006

Add and configure a Windows Forms control.

  • Use the integrated development environment (IDE) to add a control to a Windows Form or other container control of a project at design time.
  • Add controls to a Windows Form at run time.
  • Configure controls on a Windows Form at design time to optimize the UI.
  • Modify control properties.
  • Configure controls on a Windows Form at run time to ensure that the UI complies with best practices.
  • Create and configure command controls on a Windows Form.
  • Create and configure text edit controls on a Windows Form.
  • Create and configure text display controls on a Windows Form.
  • Use the LinkLabel control to add Web-style links to Windows Forms applications.
  • Provide a list of options on a Windows Form by using a ListBox control, a ComboBox control, or a CheckedListBox control.
  • Configure the layout and functionality of a Windows Form to display a list of items.
  • Implement value-setting controls on a Windows Form.
  • Configure a WebBrowser control.
  • Add and configure date-setting controls on a Windows Form.
  • Display images by using Windows Forms controls.
  • Configure the NotifyIcon component.
  • Create access keys for Windows Forms controls.

The first 4 bullets shouldn't be worrisome.  As far as as UI Best Practices, I imagine stuff like consistency, making sure your UI works with both mouse and keyboard, and making sure it functions with accessibility features are the key.  The only best practices guidance I found specific to 2.0 is this blurb on MSDN2 about the datagridview.

Here is a list of things that have changed in 2.0.  Here is a list of new features.

The command controls available in WinForms is really just the Button class.  Few things have changed since 1.1.  There's a FlatAppearance method-allowing finer control when the FlatStyle is set to Flat.  TextImageRelation specifies where the text goes in relation to an image.  There is also an AutoEllipsis property that adds the ... if your text is too long for the button.

Text Edit controls in WinForms are the ComboBox, DateTimePicker, DomainUpDown, ListBox, the new MaskedTextBox, NumericUpDown,PropertyGrid, RichTextBox, and the basic TextBox.  There is support for AutoComplete in the ComboBox and TextBox via the AutoCompleteCustomSource, AutoCompleteMode, and AutoCompleteSource properties.  I haven't used the DateTimePicker much before, but it doesn't appear to have changed.  Same for the DomainUpDown control.  The Listbox now has formatting via the FormattingEnabled and FormatString properties.  The MaskedTextBox is new, you should play around with it to understand it's features.  Jesse Liberty has a writeup on the masking features.  The NumericUpDown control hasn't changed either.  Same with the PropertyGrid.  The RichTextBox control has a RTF property that you can get/set the text including RTF codes.

The display controls in WinForms are Label, ListView, PictureBox & Treeview.  Label control has the AutoEllipsis property.  That's the only change I could see.  There are some good changes to the ListView control.  It has support for Groups and TileView.  Jeremy Epling has a writeup on Groups on his blog.   The other big change is that the ListView is bindable (Yeah!).  The PictureBox now supports Asychronous loading.  The ListView and TreeView now support Owner drawing.

The linkLabel hasn't changed.  Use it as you would a Button, except that you handle the LinkClicked event.

The CheckedListBox has the same new properties as the Listbox as far as Formatting.  It also has a new property ThreeDCheckBoxes (bool). 

To display a list of items, you could use either a CheckedListbox, ComboBox, DomainUpDown, Listbox, ListView, or TreeView.  CheckedListbox, Listbox, and ListView support multiple columns.

The WebBrowser is a new control that a hosting container for the browser.  You specify the location by setting the Url property.

You can display images a variety of different ways.  You can set the background image of a form and various controls, use a PictureBox control, you can handle the Paint event and use the graphics object to paint an image.

The NotifyIcon component now has BalloonTips.  These should be used to notify the user that something has happened.

Access keys are still defined by prefixing with an "&"

Next up-> Menus

Wednesday, February 15, 2006 6:21:37 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
 Tuesday, February 14, 2006
Manage control layout on a Windows Form.
  • Group and arrange controls by using the Panel control, GroupBox control, TabControl control, FlowLayoutPanel control, and TableLayoutPanel control.
  • Use the SplitContainer control to create dynamic container areas.

There is an article about the different layout controls by "benoyraj" at codeproject.  It's a good start to understanding these controls.  Best thing to do is to throw them on a form and play around with them a little.

Panel control hasn't changed since 1.1 (Except for the properties derived from Control like AutoSize...)  Same with GroupBox and TabControl. 

FlowLayoutControl places the controls in its container in a "flowing" order.  Kind of like web stuff.  You don't have control of the Top/Left of a control in the FlowLayoutControl.  You can set the flow to LeftToRight, TopDown, RightToLeft, or BottomUp.  David Muhundo has a blog posting describing some of his feats and concerns.

TableLayoutPanel defines a Table that you place controls in.  Again, you are giving up control over the Top/Left of the child controls in a cell.  Only one control can be placed in each cell.

Split functionality has changed significantly from v1.1.  There is now a SplitContainer that basically is two panels split either horizontally or vertically that you drop controls into.  if you are handling resizing manually, there are two events, SplitterMoved and SplitterMoving that you can capture.  There is a small FAQ (Word Document) on WindowsForms.NET.

Next up-> Windows Forms Controls

Tuesday, February 14, 2006 5:37:03 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 

Enhance the user interface of a .NET Framework application by using the System.Drawing namespace.

  • Enhance the user interface of a .NET Framework application by using brushes, pens, colors, and fonts.
  • Enhance the user interface of a .NET Framework application by using graphics, images, bitmaps, and icons.
  • Enhance the user interface of a .NET Framework application by using shapes and sizes.

Mahesh Chand has an intro to GDI+ article at vbdotnetheaven.  He also has an article describing GDI+ brushes.  Finally, there is also has an article on Pens and Fonts. 

Budi Kurianwan has nice article in C# covering the basics.

Bob Powell has an excellent intro article, and he also maintains the GDI+ FAQ.

Remember that Pens are used to draw lines and shapes, Brushes are used to fill surfaces, Fonts are used to render text, and Colors are... colors.

I suspect it would be good to know the different types of Brushes available: SolidBrush, TextureBrush, HatchBrush, LinearGradientBrush, and PathGradientBrush.

Image class is abtract, Bitmap and Metafile are the actual implementation classes.

The graphics class can draw the following types of shapes/lines: Arc, Bezier splines, Closed Cardinal Spline (ClosedCurve), Curve, Ellipse, Line, Path, Pie slice, Polygon (regular and irregular),  Rectangle.  It can fill a Closed Cardinal Spline, Ellipse, Path, Pie slice, Polygon, or Rectangle.

That's it for Section I!  Now I will begin preparing for the specifics of 70-552 (WinForms)
Next Up ->Creating a UI for a Windows Forms Application by Using Standard Controls

Tuesday, February 14, 2006 5:03:51 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
 Monday, February 13, 2006
Send electronic mail to a Simple Mail Transfer Protocol (SMTP) server for delivery from a .NET Framework application. (Refer System.Net.Mail namespace)
  • MailMessage class
  • MailAddress class and MailAddressCollection class
  • SmtpClient class, SmtpPermission class, and SmtpPermissionAttribute class
  • Attachment class, AttachmentBase class, and AttachmentCollection class
  • SmtpException class, SmtpFailedReceipientException class, and SmtpFailedReceipientsException class
  • SendCompletedEventHandler delegate
  • LinkedResource class and LinkedResourceCollection class
  • AlternateView class and AlternateViewCollection class

This is a completely new namespace.  The old System.Web.Mail namespace has been deprecated.  This new implementation is not dependent on CDO.  Dr. Peter Bromberg has an introductory article on the new features.  There is also the infamous www.systemnetmail.com site.

MailMessage class - Represents an email message.  New properties for this (compared to the properties in the web.mail version) are DeliveryOptions, ReplyTo, and SubjectEncoding.  There is also support for AlternateViews - allowing you to send both text and HTML representations of the email.

MailAddress class - Represents an email address.  Address, DisplayName, Host, and User are readonly properties of this object.  Properties are set in the constructor.

MailAddressCollection class - Collection of MailAddress objects. 

SmtpClient class - This class sends email via SMTP.  It is not dependent on CDO, it can work over SSL, and the send can be performed async.

SmtpPermission class - This class regulates whether or not an application can send mail via SMTP.  Access can be locked down to no access, only via the default port (25), or unrestricted.  What's interesting is that this class doesn't appear in the Create Permission Set wizard.

SmtpPermissionAttribute class - Attribute implementation of the SmtpPermission class.

SmtpException class - Exception that is thrown when SMTP Client can't complete a send or sendasync operation.

SmtpFailedReceipientException class - Exception that is thrown when a receipient is not valid.

SmtpFailedReceipientsException class - Exception that is thrown when an email can't be sent to ALL of the receipients.  "This class supports the .NET Framework infrastructure and is not intended to be used directly from your code. "... The following statement from the remarks in the documentation contradicts the explanation: "The InnerExceptions property contains the exceptions received while attempting to send e-mail. The e-mail might have been successfully delivered to some of the recipients."

SendCompletedEventHandler delegate - Delegate that is called when an async send is complete.  Handles the SendCompleted event.

LinkedResource class - Represents an embedded resource in a message, such as a HTML image.

LinkedResourceCollection class - Collection of LinkedResources.

AlternateView class - This class is used to represent an alternate view of a mail message.  This would likely be an HTML version of the email. 

AlternateViewCollection class - Collection of AlternateView objects.  This is used in the AlternateViews property on the MailMessage object.

Next up -> GDI

Monday, February 13, 2006 7:31:33 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 

Access and modify identity information by using the System.Security.Principal classes. (Refer System.Security.Principal namespace)

  • GenericIdentity class and GenericPrincipal class
  • WindowsIdentity class and WindowsPrincipal class
  • NTAccount class and SecurityIdentifier class
  • IIdentity interface and IPrincipal interface
  • WindowsImpersonationContext class
  • IdentityReference class and IdentityReferenceCollection class

This is all about the identity.  It would help to have a good understanding of the identity infrastructure in .NET.  There is a good writeup on the basics by Bipin Joshi.

GenericIdentity class - Represents a "Generic" user. 

GenericPrincipal class - Represents a "Generic" principal.

WindowsIdentity class - Represents a windows user.  Keith Brown has a good writeup on WindowsIdentity and WindowsPrincipal on his .NET Developers Guide to Security.

WindowsPrincipal class - Provides the ability to check the Windows group membership of a Windows user.

NTAccount class - New to 2.0 Represents an NT User or Group. This class has the ability to get the security identifier (useful for access control operations) via the translate method.

SecurityIdentifier class - New to 2.0. Represents a Windows Security Identifier (SID).  Useful for ACL operations.

IIdentity interface - Defines the basic functionality of an identity object.  Name, AuthenticationType, and IsAuthenticated are the members that must be implemented.

IPrincipal interface - Defines the basic functionality of a principal object.  Identity and IsInRole must be implemented.

WindowsImpersonationContext class - Represents a windows user prior to impersonation.  Allows you to revert back to the original user by calling the Undo method.  Marc Merritt has a nice simple demonstration at The Code Project.

IdentityReference class - New to 2.0.  Base class for NTAccount and SecurityIdentifier classes.

IdentityReferenceCollection class - New to 2.0.  Collection of IdentityReference classes.  Has a translate method to change objects from one type of identity to another.  An example would be from NTAccount to SecurityIdentifier.

Next up -> System.Net.Mail

Monday, February 13, 2006 5:37:43 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 

I'll be speaking at Boston Access Day (The Boston area Microsoft Access usergroup) this Wednesday, February 15th.  I'll be doing a two part talk:

Introduction to SQL Server Express - SQL Express is a lightweight version of SQL Server 2005 that is easy to install and use in your applications. Unlike its predecessor MSDE, this engine has been optimized for small business applications. Phil will talk about the features, capabilities and limitations of SQL Server Express.

Improving SQL Server Performance - How to troubleshoot performance problems in SQL Server, and ways to overcome them.  Phil will talk about common problems, the tools used to monitor SQL Server, and possible fixes for the problems.

I've been a member of this group for over 10 years.  I haven't done Access development in over 5 years, but it's good to go back and see old friends.

Monday, February 13, 2006 4:23:52 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Speaking Engagements  | 
Control code privileges by using System.Security.Policy classes. (Refer System.Security.Policy namespace)
  • ApplicationSecurityInfo class and ApplicationSecurityManager class
  • ApplicationTrust class and ApplicationTrustCollection class
  • Evidence class and PermissionRequestEvidence class
  • CodeGroup class, FileCodeGroup class, FirstMatchCodeGroup class, NetCodeGroup class, and UnionCodeGroup class
  • Condition classes
  • PolicyLevel class and PolicyStatement class
  • IApplicationTrustManager interface, IMembershipCondition interface, and IIdentityPermissionFactory interface

ApplicationSecurityInfo class - New to 2.0. I've been looking for this class. This class holds information about the evidence belonging to the assembly. It also has the default permission set assigned to the assembly. This will make troubleshooting CAS problems much easier.

ApplicationSecurityManager class - "Manages trust decisions for manifest activated applications"? There has to be a better way to document this class. There is an ApplicationTrustManager property that provides access to the ApplicationTrustManager object for the assembly. People more familiar with Clickonce might recognize where this would be used.

ApplicationTrust class - Encapsulates security decisions for an application. Has properties such as ApplicationIdentity, DefaultGrantSet, IsApplicationTrustedToRun.

ApplicationTrustCollection class - Collection of ApplicationTrusts. Again, I'm not real strong on the clickonce stuff (which is where I think this stuff comes in handy), but I don't see why I would ever have more than one ApplicationTrust?

Evidence class - Holds the evidence that belongs to the assembly. You can enumerate with this object to get all the associated evidence.

PermissionRequestEvidence class - Representation of all the RequiredPermissions, OptionalPermissions, and DeniedPermissions that are needed to run the assembly. These are declaratively stated by the developer.

CodeGroup class - Abtract class that represents a code group.

FileCodeGroup class - generates a set of permission containing  FileIOPermissions that grant read-only access to the application directory .

FirstMatchCodeGroup class - "Allows security policy to be defined by the union of the policy statement of a code group and that of the first child code group that matches."  The .NET Security blog has a tidbit on this class.

NetCodeGroup class - Grants web permission to the site the code was downloaded from. 

UnionCodeGroup class - "Represents a code group whose policy statement is the union of the current code group's policy statement and the policy statement of all its matching child code groups. ".  This is the default and most-often used type of CodeGroup.

Condition classes - There are quite a few condition classes, all implementing IMembershipCondition.  A condition is assigned to a code group which controls whether or not the permission set belonging to the code group is applied.

AllMembershipCondition - This is your 1==1 class.  Always matches.

ApplicationDirectoryMembershipCondition - This matches when the code is located in the application directory.

GACMembershipCondition - New to 2.0. This produces a match if the assembly is located in the GAC.

HashMembershipCondition - Produces a match if a hash matches a hash of the assembly.  The hash can be produced by using the Code Group Wizard.

PublisherMembershipCondition - Produces a match if the assembly was produced by a specific publisher identitified using Authenticode certificates.

SiteMembershipCondition - Produces a match if the assembly is located in a specific site.  The site is basically the domain name.

StrongNameMembershipCondition - Produces a match if the assembly has a specific strong name.

UrlMembershipCondition - Produces a match if the URL of assembly matches a Url.  The Url can have a wildcard in the final position.

ZoneMembershipCondition - Produces a match if the assembly was downloaded from a specific Zone (Internet, Intranet, Trusted Sites...)

PolicyLevel class - Represents the security policy levels for the CLR.  There are four policy levels : Enterprise, Machine, User, and AppDomain.

PolicyStatement class - Represents the set of granted permissions, given a set of evidence.  The Resolve method in the PolicyLevel returns this object.

IApplicationTrustManager interface - New to 2.0.  If you're writing your own Trust Manager, you're required to implement this interface.  This is used to implement Manifest-based Activation (Clickonce)

IMembershipCondition interface - Condition classes (see above) are required to implement this interface.  If you're writing your own custom membership condition, you would implement this interface.

IIdentityPermissionFactory interface - "Defines the method that creates a new identity permission. "  It appears all evidence classes should implement this class.  I don't completely understand the intent of this interface.

Next up -> Security.Principal

Monday, February 13, 2006 4:16:23 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
Copyright © 2009 Phil Denoncourt III. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: