TFORMer SDK - NET  8
Public Member Functions | Properties
Repository Class Reference

Opens or creates a Repository, opens a stand-alone FormLayout. More...

List of all members.

Public Member Functions

 Repository (string filename, bool createNewRepository, bool isReadOnly)
 Constructor for Repository objects.
JobTrayControl AddJobTrayControl (string name)
 Creates and adds a new JobTrayControl to the Repository.
Printer AddPrinter (string name)
 Creates and adds the Printer to the Repository.
Project AddProject (string name)
 Creates and adds the Project in the Repository.
void Close (bool commitChanges)
 Close this Repository.
void Dispose ()
 Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
JobTrayControl GetJobTrayControl (string name)
 Gets a JobTrayControl defined in the Repository.
Printer GetPrinter (string name)
 Gets the Printer from the Repository.
Project GetProject (string name)
 Gets the Project defined in the Repository.
void RemoveJobTrayControl (string name)
 Removes the JobTrayControl from the Repository.
void RemoveJobTrayControl (JobTrayControl jobTrayControl)
 Removes the JobTrayControl from the Repository.
void RemovePrinter (string name)
 Removes the Printer from the Repository.
void RemovePrinter (Printer printer)
 Removes the Printer from the Repository.
void RemoveProject (string name)
 Removes the Project from the Repository.
void RemoveProject (Project project)
 Removes the Project from the Repository.
void Save ()
 Saves this Repository.
void SaveAs (string filename)
 Saves a copy of this Repository.
override string ToString ()
 Returns a string representation of the instance.

Properties

bool AutoSave [get, set]
 Gets/Sets a flag indicating whether to save changes to the Repository automatically.
int BuildNumber [get]
 Gets the build number of the Repository.
string Comment [get, set]
 Gets/Sets the comment for the Repository.
DataSource DefaultDataSource [get]
 Gets the default DataSource.
JobTrayControl DefaultJobTrayControl [get]
 Gets the default JobTrayControl in the Repository.
Printer DefaultPrinter [get]
 Gets the Default Printer of the Repository.
string Description [get, set]
 Gets/Sets the description of the Repository.
DirectoryConnectorList DirectoryConnectorList [get]
 Gets the DirectoryConnectorList stored in the Repository.
JobTrayControl FirstJobTrayControl [get]
 Gets the first JobTrayControl in the Repository.
Printer FirstPrinter [get]
 Gets the first Printer stored in the Repository.
Project FirstProject [get]
 Gets the first Project stored in the Repository.
FtpConnectorList FtpConnectorList [get]
 Gets the FtpConnectorList stored in the Repository.
string FullPath [get]
 Gets the full pathname of the Repository.
Project GlobalProject [get]
 Gets the global Project of the Repository.
bool IsModified [get, set]
 Gets/Sets a flag indicating whether this Repository has been modified.
bool IsReadOnly [get]
 Gets a flag indicating whether this Repository is read-only.
int NumberOfJobTrayControls [get]
 Gets the number of JobTrayControl-objects stored in the Repository.
int NumberOfPrinters [get]
 Gets the number of printers defined in the Repository.
int NumberOfProjects [get]
 Gets the number of Project-objects stored in the Repository.
OdbcConnectorList OdbcConnectorList [get]
 Gets the OdbcConnectorList stored in the Repository.
ServerSettings ServerSettings [get]
 Gets the ServerSettings in the Repository.
TCPConnector TCPConnector [get]
 Gets the TCPConnector stored in the Repository.
UserListener UserListener [get]
 Gets the UserListener stored in the Repository.
int VersionMajor [get]
 Gets the major version number of the Repository.
int VersionMinor [get]
 Gets the minor version number of the Repository.
VirtualPrinter VirtualPrinter [get]
 Gets the VirtualPrinter stored in the Repository.

Detailed Description

Opens or creates a Repository, opens a stand-alone FormLayout.

Overview

A Repository is represented by a master file (extension *.tfr) and a subfolder structure on the file system. It references an arbitrary number of user-defined Project objects. These user-defined Projects are used to divide a Repository into logical areas. Each Project is a container which holds DataField definitions, DataSource definitions and references an arbitrary number of FormLayout objects.

The so-called GlobalProject is allocated by default and is exclusively used to define DataFields which are available for all FormLayouts regardless of their actual Project membership.

Note:
In contrast to a stand-alone FormLayout, the GlobalProject of a Repository can not store references to a FormLayout.

Examples

To open a stand-alone FormLayout do the following:

  // Create a new Repository instance using a stand-alone FormLayout (extension *.tff)
  // Examples are usually installed in
  // - Windows Vista or later: C:/Program Data/TEC-IT/TFORMer/8/Examples
  // - Older Microsoft Windows versions: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/8/Examples
  Repository repository = new Repository(@"C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/8/Examples/Command Line/ODBCReportPDF/ODBCReportPDF.tff", false, true);

To open a Repository do the following:

  // Create a new Repository instance using a Repository (extension *.tfr)
  // Examples are usually installed in
  // - Windows Vista: C:/Program Data/TEC-IT/TFORMer/8/Examples
  // - Older Microsoft Windows versions: C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/8/Examples
  Repository repository = new Repository(@"C:/Documents and Settings/All Users/Application Data/TEC-IT/TFORMer/8/Examples/Demo Repository/Demos.tfr", false, true);  
Note:
This class writes only changes to Repository-files (extension *.tfr) to disk. A stand-alone FormLayout cannot be created, saved or permanently modified on disk via this class.
Thread-safety: A single instance of this class must not be used by different threads.

Constructor & Destructor Documentation

Repository ( string  filename,
bool  createNewRepository,
bool  isReadOnly 
)

Constructor for Repository objects.

Calls native allocation methods and either creates a new Repository or opens an existing Repository or a stand-alone FormLayout.

Parameters:
filenameThe full path of a new or existing Repository (see also Passing Files)
createNewRepositorytrue if a new Repository should be created, false if an existing Repository should be opened
isReadOnlytrue if Repository should be opened read-only (only when opening an existing Repository)
See also:
Passing Files

Member Function Documentation

Creates and adds a new JobTrayControl to the Repository.

For a stand-alone FormLayout this method is not available

Parameters:
nameThe name of the JobTrayControl.
Returns:
The JobTrayControl object
See also:
JobTrayControl
Printer AddPrinter ( string  name)

Creates and adds the Printer to the Repository.

Attention:
Internal use only
Parameters:
nameThe name the Printer
Returns:
The Printer
Project AddProject ( string  name)

Creates and adds the Project in the Repository.

For a stand-alone FormLayout this method is not available. A stand-alone FormLayout contains only a GlobalProject which can't be retrieved by name.

Parameters:
nameThe name of the Project
Returns:
The Project
See also:
Project
void Close ( bool  commitChanges)

Close this Repository.

Any changes to a stand-alone FormLayout are not written to disk (see Save(), SaveAs() or Repository). Thus you can't create new stand-alone FormLayouts.

Parameters:
commitChangesIf you call this method with commitChanges = false, all changes will be lost (even if AutoSave() is enabled)!
void Dispose ( )

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

The Repository will be closed, changes are saved if AutoSave() is set to true.

Gets a JobTrayControl defined in the Repository.

Parameters:
nameThe name of the JobTrayControl.
Returns:
A valid object instance or null
See also:
JobTrayControl
Printer GetPrinter ( string  name)

Gets the Printer from the Repository.

Attention:
Internal use only
Parameters:
nameThe name of the Printer
Returns:
A valid object instance or null
Project GetProject ( string  name)

Gets the Project defined in the Repository.

For a stand-alone FormLayout this method is not available. A stand-alone FormLayout contains only a GlobalProject which can't be retrieved by name.

Parameters:
nameThe name of the Project
Returns:
A valid object instance or null
See also:
Project
void RemoveJobTrayControl ( string  name)

Removes the JobTrayControl from the Repository.

Parameters:
nameThe name of the JobTrayControl.
See also:
JobTrayControl
void RemoveJobTrayControl ( JobTrayControl  jobTrayControl)

Removes the JobTrayControl from the Repository.

For a stand-alone FormLayout this method is not available

Parameters:
jobTrayControlThe JobTrayControl instance.
See also:
JobTrayControl
void RemovePrinter ( string  name)

Removes the Printer from the Repository.

Attention:
Internal use only
Parameters:
nameThe name of the Printer
void RemovePrinter ( Printer  printer)

Removes the Printer from the Repository.

Attention:
Internal use only
Parameters:
printerThe Printer
void RemoveProject ( string  name)

Removes the Project from the Repository.

For a stand-alone FormLayout this method is not available.

Parameters:
nameThe name of the Project
See also:
Project
void RemoveProject ( Project  project)

Removes the Project from the Repository.

For a stand-alone FormLayout this method is not available.

Parameters:
projectThe Project
See also:
Project
void Save ( )

Saves this Repository.

For a stand-alone FormLayout this property is not available

void SaveAs ( string  filename)

Saves a copy of this Repository.

For a stand-alone FormLayout this method is not available.

Parameters:
filenameThe filename of the Repository
override string ToString ( )

Returns a string representation of the instance.

Returns:
A string representation of the instance

Property Documentation

bool AutoSave [get, set]

Gets/Sets a flag indicating whether to save changes to the Repository automatically.

If AutoSave is set to true all changes will be saved even when this instance is disposed without calling Close(). If you call Close() directly with commitChanges = false all changes will be lost!

The state of the AutoSave property is not stored on the hard disk. AutoSave is always true after creating or opening a Repository with read/write access.

Returns:
If true changes to the Repository will be saved automatically.
int BuildNumber [get]

Gets the build number of the Repository.

Returns:
The build number of the Repository
string Comment [get, set]

Gets/Sets the comment for the Repository.

For a stand-alone FormLayout this property is not available

Returns:
The comment for the Repository.

Gets the default DataSource.

Returns:
The default DataSource.
See also:
DataSource

Gets the default JobTrayControl in the Repository.

Returns:
The default JobTrayControl in the Repository
See also:
JobTrayControl
Printer DefaultPrinter [get]

Gets the Default Printer of the Repository.

For a stand-alone FormLayout this property is not available

Returns:
The Default Printer of the Repository.
Attention:
Internal use only
string Description [get, set]

Gets/Sets the description of the Repository.

For a stand-alone FormLayout this property is always empty

Returns:
The description of the Repository

Gets the DirectoryConnectorList stored in the Repository.

Returns:
The DirectoryConnectorList stored in the Repository.
Attention:
Internal use only

Gets the first JobTrayControl in the Repository.

Returns:
The first JobTrayControl in the Repository
See also:
JobTrayControl
Printer FirstPrinter [get]

Gets the first Printer stored in the Repository.

Returns:
The first Printer stored in the Repository.
Attention:
Internal use only

Gets the first Project stored in the Repository.

For a stand-alone FormLayout always null is returned. Use GlobalProject instead.

Returns:
The first Project stored in the Repository, null if it doesn't exist
See also:
Project

Gets the FtpConnectorList stored in the Repository.

Returns:
The FtpConnectorList stored in the Repository.
Attention:
Internal use only
string FullPath [get]

Gets the full pathname of the Repository.

Returns:
The full pathname of the Repository

Gets the global Project of the Repository.

Returns:
The global Project of the Repository.
See also:
Project
bool IsModified [get, set]

Gets/Sets a flag indicating whether this Repository has been modified.

Attention:
Internal use only
Returns:
true if this Repository was modified
bool IsReadOnly [get]

Gets a flag indicating whether this Repository is read-only.

Read-only means that the Repository can be changed in memory but changes won't be written to disk.

Returns:
true if this instance is read-only.

Gets the number of JobTrayControl-objects stored in the Repository.

Returns:
The number of JobTrayControl-objects stored in the Repository.
See also:
JobTrayControl
int NumberOfPrinters [get]

Gets the number of printers defined in the Repository.

Returns:
The number of printers defined in the Repository.
int NumberOfProjects [get]

Gets the number of Project-objects stored in the Repository.

The GlobalProject is not counted, so the number of Project-objects is always 0 for stand-alone FormLayouts.

Returns:
Gets the number of Project-objects stored in the Repository.
See also:
Project

Gets the OdbcConnectorList stored in the Repository.

Returns:
The OdbcConnectorList stored in the Repository.
Attention:
Internal use only

Gets the ServerSettings in the Repository.

For a stand-alone FormLayout the ServerSettings are not available

Returns:
The ServerSettings stored in the Repository
Attention:
Internal use only

Gets the TCPConnector stored in the Repository.

Returns:
The TCPConnector stored in the Repository.
Attention:
Internal use only

Gets the UserListener stored in the Repository.

Returns:
The UserListener stored in the Repository.
Attention:
Internal use only
int VersionMajor [get]

Gets the major version number of the Repository.

Returns:
The major version number of the Repository
int VersionMinor [get]

Gets the minor version number of the Repository.

Returns:
The minor version number of the Repository

Gets the VirtualPrinter stored in the Repository.

Returns:
The VirtualPrinter stored in the Repository.
Attention:
Internal use only

© 2006-2024 - all rights reserved by TEC-IT Datenverarbeitung GmbH
Generated on Wed Aug 7 2024 17:29:42 for TFORMer SDK - NET with doxygen 1.7.6.1