/*
**      Newton Developer Technical Support Sample Code
**
**      ArchiveTransport, a Newton transport example
**
**      by Ryan Robertson and J. Christopher Bell, Newton Developer Technical Support
**
**      Copyright © 1994-6 by Apple Computer, Inc.  All rights reserved.
**
**      You may incorporate this sample code into your applications without
**      restriction.  This sample code has been provided "AS IS" and the
**      responsibility for its operation is 100% yours.  You are not
**      permitted to modify and redistribute the source as "DTS Sample Code."
**      If you are going to re-distribute the source, we require that you
**      make it clear in the source that the code was descended from
**      Apple-provided sample code, but that you've made changes.
*/

partData := {};

InstallScript := func(partFrame,removeFrame)
	begin
		// A reference to the transport is stuffed into the partFrame in the 
		// AfterScript of the "MyTransport" layout.
		RegTransport(kAppSymbol, partFrame.partData.(kAppSymbol));
	end;

RemoveScript := func(removeFrame)
	begin
		UnregTransport(kAppSymbol);
	end;

SetPartFrameSlot( 'DeletionScript, 
	func()
		begin
			// The DeletionScript is called whenever a new version of the project 
			// package is downloaded with NTK. During development we want to keep our
			// transport preferences persistent over multiple downloads, so we only call 
			// DeleteTransport if kDebugOn is nil.  The kDebugOn flag is true when we
			// check "Compile for Debugging" in our project's settings.
			if NOT kDebugOn then
				DeleteTransport(kAppSymbol);
		end;);