Skip to content

ATF Code Samples

Gary edited this page Jan 24, 2015 · 4 revisions

The following sample applications are shipped with the ATF in the ATF\Samples folder. These sample applications show how to use ATF components to build applications with particular elements and functionality. To try them, open and build one of the Visual Studio solutions:

  • \Samples\Samples.sln: includes all of the samples and ATF framework.
  • \Test\Everything.sln: includes ATF 3 and ATF 2 framework and samples, unit tests, functional tests, and development tools. (ATF 2 is not on GitHub.)
Each sample has its own project in the solution. The Win Forms App and Wpf App samples are under the WinGui folder in Visual Studios Solution Explorer and share common code. The sample applications' executables are placed in each sample application's bin folder.

The sample applications build on each other, from the simplest functionality of File Explorer's file hierarchy display to the more complex Diagram Editor, which combines several sample applications to show how multiple applications can share one application shell.

Click each sample's link to view a description. Also, it may be helpful to view the Technology and Samples Matrix, showing where key technologies are used in sample applications.

For information about how the samples are programmed, see ATF Code Samples Discussions.

Code Sample Purpose
Circuit Editor This sample is an editor for circuits, consisting of modules with input and output pins and connections between them. It uses an XML schema to define the data file format, reads and writes XML circuit files, and allows circuits to be edited using a graphical representation of modules and connections. It uses the AdaptableControl to display and edit the circuit. Multiple documents can be edited simultaneously. CircuitEditor uses several ATF Editor components to implement standard editing commands. CircuitEditor also demonstrates:
* Prototyping: you can create a custom set of circuit fragments that can be inserted into documents.
* Layering: you can assign diagram components to layers which can be turned on and off (visible and invisible).
Code Editor This sample is a code editor that uses the ActiproSoftare SyntaxEditor to provide an editing Control. It provides language syntax sensitive editing for plain text, C#, Lua, Squirrel, Python, XML, COLLADA and Cg files.
Diagram Editor This sample editor combines the Circuit, Finite State Machine, and State Chart editors into a single application to show how multiple editors can share an application shell and editor components. Note that not all of the related features of each of the other editors are included, so if you are mainly interested in circuits, for example, please take a look at the Circuit Editor sample app.
DOM Tree Editor This sample is an editor that operates on simple User interface definition files. The UI data is hierarchical and DomTreeEditor displays is in a TreeControl. You can select and edit UI elements in the tree, and you can edit the properties on the selected elements.
File Explorer This sample shows how to build a simple Windows® Explorer-like application to view the contents of your hard drive. It demonstrates ATF features including the use of MEF to put applications together and develop a file view, use of the application shell framework, use of controls such as TreeControl, use of ATF list components to list files in the selected file folder, use of the UserFeedbackService for bug reporting, and use of the VersionUpdateService for upgrading to the latest SHIP version of the application.
Fsm Editor This sample is a finite state machine editor. You can drag states from a palette onto a canvas and connect the states with transitions. A list or grid property editor allows you to edit states and transitions. You can create prototypes from selected states and transitions.
Model Viewer This model viewer shows how to use the ATF's ATGI and Collada file loaders and OpenGL® rendering.
DOM Property Editor This sample app demonstrates property editing, with a large variety of property editing controls and property descriptors. The values of the properties are stored in the DOM (Document Object Model).
Simple DOM Editor This sample editor demonstrates the use of the DOM (Document Object Model), including defining a data model. It shows how to implement IDocumentClient and use the document framework to manage multiple documents, how to implement File menu items and more. It shows how to implement a UI parts palette and how to display editable lists of events and resources, how to adapt data to a list, and how to use ContextRegistry to track the active editing context. It also demonstrates how to adapt data so that ATF command components can be used to get undo/redo, cut/paste, and selection commands, how to enable property editing on selected UI elements, and how to implement a standard Help/About dialog.
Simple DOM Editor WPF This sample is very similar to the SimpleDomEditor sample, but it is implemented using ATF's WPF framework. It demonstrates the use of the DOM (Document Object Model) with data containing a sequence of events, which can contain resources. Each event sequence file displays in a WPF Grid containing a ListView control, which shows all events and resources that can be selected and edited, as well as the properties on the selected items to be edited. The Resources editor tracks the last selected event and displays its resources in another ListView control in a Grid.
Simple DOM No XML Editor This sample editor is very similar to the Simple DOM Editor sample, but does not use XML. It demonstrates the use of the DOM (Document Object Model), but does not use an XML schema for its data model. It shows how to implement IDocumentClient and use the document framework to manage multiple documents, how to implement File menu items and more. It shows how to implement a UI parts palette and how to display editable lists of events and resources, how to adapt data to a list, and how to use ContextRegistry to track the active editing context. It also demonstrates how to adapt data so that ATF command components can be used to get undo/redo, cut/paste, and selection commands, how to enable property editing on selected UI elements, and how to implement a standard Help/About dialog.
State Chart Editor This sample is an editor for statecharts. It uses an XML schema to define the data file format, reads and writes XML statechart files, and allows them to be edited using a graphical representation of states and transitions. It uses the AdaptableControl to display and edit the statechart. Annotations, which are comments pasted on to the document canvas, can be added. Multiple documents can be edited simultaneously. Many ATF Editor components are used to implement standard editing commands. StatechartEditor also demonstrates prototyping: how the user can create a custom set of statechart fragments that can be inserted into documents.
Target Manager This sample shows how to use the TargetEnumerationService to discover, add, configure and select targets, which are network endpoints, such as TCP/IP addresses, PS3™ DevKits (to be added) or PlayStation®Vita DevKits. It demonstrates ATF features, such as using the application shell framework and target plugins.
Timeline Editor This sample is a relatively full-featured timeline editor whose components have been used in real production tools. It shows how to use MEF to put an application together using optional components, use of the application shell framework, how to use the timeline manipulators and a manipulator architecture that allows adding or removing a TimelineControl's functionality without modifying the TimelineControl, how to use the Palette as a parts depot for timeline objects, use of the property and grid property editors, sub-document support, how to enable opening multiple documents simultaneously, and copy and paste within and between documents.
Tree List Editor This sample editor shows how to create and add entries to various kinds of Tree lists, including a hierarchical list to display selected folders' underlying folders and files. It demonstrates ATF features such as using the application shell framework, use of controls such as TreeListView and use of the SettingsService to persist list column widths. The sample shows adding and removing list items and notifying the user of these events.
Using Direct2D This sample application demonstrates how to use Direct2D and ATF classes that support Direct2D. It does not use MEF.
Using Dom This sample application is a simple demo of basic DOM use. It has no UI, running in a command prompt window.
Clone this wiki locally