Enhancing the VS.NET Design-Time Experience.
Kevin McNeish.
NET246.
These session notes serve primarily to share the content of the session and as a reference for me. They may also provide some value to those interested in the session topics. Some of the information found in these notes may be inaccurate due to my typing errors or a lack of understanding of the subject matter. DevTeach policy is that session material is available online to registered attendees only, so I cannot respond to any requests for session PPTs or source.
IComponent interface in common between Web Controls and Windows controls.
Applying design-time attributes to your components.
Sample code with session.
Component -> subclasses a Textbox. (Doesn't yet look like a text box.)
Subclass Microsoft's User Controls.
Override Text . if (!(this.DesignMode && value == this.Name))
Can't check it in constructor in design mode.
mmSolution.cs grabs the process ID and determines the current instance of VS.NET. DTE is the highest object of VS.NET. Use GetDTE() to get a reference to all of the VS.NET elements.
Automated data binding. Business object raises events with user control responding to that event. Added four properties to his controls: BindingFlag, BindingProperty, BindingSource, BindingSourceMember.
Attributes. Attributes are classes. For BindingFlag [Category("Data"), Description(...), DefaultValue()] DefaultValue for Reset popup enabled.
BindingSource. Dialog [...] popup created using the automation object of VS.NET.
mmTextBox. Editor(typeof(mmBindingSourc.., typeof(UITypeEditor) as attribute. Must override GetEditStyle (to modal) and EditValue.
Get the IWIndowsFormsEditorService and display the form.
The dialog box calls the automation object are returns a list of the business classes. The GetBusinessObjects retrieves XML business.config file. Business.config uses object relational mapping.
Can override default property window behaviors. Attributes. On the class (for example) [ToolboxBitmap(typeof(TextBox))]
Adding controls to a toolbox. Customize Toolbox default list. Look for HLM\Software\MS\VS\7.1\AssemblyFolders to add registry entry.
MS Partners get the VS Integration Kit.
Design-Time attributes are inherited (with exception of the ToolboxBitmap.)
MmTextBox : TextBox, ImmBindingSimple
Implements ImmBindingSimple as an interface
Passes the interface to the Bind control method.
Registers the control to the PersistenceManager listener.
Public class mmStateChangedEventArgs : EventArgs
Summary: It was great listening to Kevin again. He was one of my favorite presenters from last year. As for the session content, I'm blown. Blown! I will keep on keeping on with my current IDE experience, but will review these techniques and Kevin’s presentation materials when working in Windows Forms. 10 out of 10.