ATF Win Forms App Sample - kaisu1986/ATF GitHub Wiki
WinFormsApp is a a basic WinForms sample application. It illustrates how to compose a WinForms application with ATF components using MEF. It is a starting point for an application, such as an editor, though WinFormsApp does not offer any editing capabilities.
The WinFormsApp sample shares much code with the WpfApp sample, so the two provide a similar set of capabilities. In fact, the two applications differ by only a few files; the bulk of the application code is in common. This demonstrates the ease of developing an ATF application and converting it from WinForms to WPF or vice versa.
For details on programming in the sample, see WinForms and WPF Apps Programming Discussion.
- Use of Managed Extensibility Framework (MEF) to put applications together.
- Use of the application shell framework, including CommandService, SettingsService, ControlHostService and WindowLayoutService.
- Show loading a schema with SchemaLoader.
- Double-click the WinFormsApp.exe in ATF\Samples\WinFormsApp\bin\Release.
- A dialog appears with a list box for application data.

- File: create a new or open an existing Gui App Data (.gad) file, Save, Save as, Save all, Close and Exit WinFormsApp.
- Edit:
- Keyboard Shortcuts: use the Customize Keyboard Shortcuts window to set up keyboard shortcuts.
- Load or Save Settings: use the Load and Save Settings window to save current WinFormsApp application settings or load application settings from a file.
- Preferences: set application preferences, such as command icon size.
- Window:
- Tile Horizontal: tile window panes horizontally.
- Tile Vertical: tile window panes vertically.
- Tile Overlapping: overlap window panes horizontally.
- Layouts:
- Save Layout As...: associate the current layout with a name.
- Manage Layouts...: show a list of layouts and manage the list.
- Lock/Unlock UI Layout: lock/unlock window pane layout.
- List of checked menu items; check to activate the corresponding control.
WinFormsApp provides a schema with event, animation and other types; it also has the capability of loading a schema. WinFormsApp also has code to handle events and resources involving DomNodes. However, it does not provide editing capabilities for creating or changing application data.
Modules perform these functions:
- Program.cs: Contains the Main program. It creates a TypeCatalog listing the ATF and internal classes used.
- Editors.cs: Implements IDocumentClient to open, show, save and close documents.
- SchemaLoader.cs: Loads the event schema, registers data extensions on the DOM types, annotates the types with display information and PropertyDescriptors.
- EventContext.cs and WinGuiCommonDataContext.cs: Provide a context for data.