NShape Reference
XmlStore Class

<< Click to Display Table of Contents >>

Navigation:  Class Reference > Namespace Dataweb.NShape >

NShape Reference
XmlStore Class

Previous pageReturn to chapter overviewNext page

Implementation of a XML based store.

Syntax

public class XmlStore : Store

Description

The XML Store reads and writes the project from and to an XML file. In contrast to the ADO.NET repository, it keeps the whole object model in memory and is therefore able to deliver a complete image of the model at any time.

An XML store consists of an XML file and optionally - depending on the value of the ImageLocation property - a corresponding directory named "<ProjectName> Images" where the store's images are saved.

If the repository already exists, the existing file (and its corresponding directory) will be renamed to *.bak before the repository is saved.

Public Properties

Name

Description

BackupFileExtension

Specifies the file extension of automatically created backup copies.

The BackupFileExtension will be appended to the existing file extension, e.g. 'Project1.nspj' becomes 'Project1.nspj.bak'.

BackupGenerationMode

Gets or sets a BackupFileGenerationMode value that specifies whether a backup for the current contents should be created when saving changes to file.

DesignFileName

Name of the file containing additional design definitions.

DesignFilePath

Returns the full path to the design file.

DirectoryName

Specifies the directory where the XML file is located.

FileExtension

Specifies the file extension of the XML file.

ImageLocation

Gets or sets an ImageFileLocation value that specifies whether images are stored as files in a separate image directory or embedded as base 64 string.
When loading an existing XML file, the ImageLocation setting of the file will be determined and used until it the XmlStore is closed or the ImageLocation is overridden by setting the ImageLocation property while the XmlStore is open.

LazyLoading

Gets or sets whether diagrams should be loaded without contents (lazy loading). When enabling LazyLoading, the diagram's content must be loaded explicitly by calling the IRepository.GetDiagramShapes method.
Make sure that all diagram shapes have been loaded before saving!

ProductVersion

The version of the component.

ProjectFilePath

Returns the full path to the XML file.

ProjectName

Specifies the XML file's name.

Version

Specifies the current storage format version.

Public Methods

Name

Description

Constructor

Constructs a new XML store instance.

Close

Closes the store and clears all its content.

Create

Creates and initializes a new store.

Erase

Erases an existing XML file and its corresponding image directory.

Exists

Returns whether the file specified by ProjectFilePath exists.

LoadChildModelObjects

If the XML file has not been loaded completely, it will be loaded. Otherwise, this method does nothing.

LoadChildShapes

If the XML file has not been loaded completely, it will be loaded. Otherwise, this method does nothing.

LoadDesigns

As the designs are loaded along with the project settings when the store is opened, this method does nothing.

LoadDiagrams

If the XML file has not been loaded completely, it will be loaded. Otherwise, this method does nothing.

LoadDiagramShapes

If the XML file has not been loaded completely, it will be loaded. Otherwise, this method does nothing.

LoadModel

If the XML file has not been loaded completely, it will be loaded. Otherwise, this method does nothing.

LoadModelModelObjects

If the XML file has not been loaded completely, it will be loaded. Otherwise, this method does nothing.

LoadProjects

As the project(s) are loaded when the store is opened, this method does nothing.

LoadTemplateModelObjects

If the XML file has not been loaded completely, it will be loaded. Otherwise, this method does nothing.

LoadTemplates

If the XML file has not been loaded completely, it will be loaded. Otherwise, this method does nothing.

LoadTemplateShapes

If the XML file has not been loaded completely, it will be loaded. Otherwise, this method does nothing.

Open

See DoOpen method.

SaveChanges

Stores the content of the store in an XML file. Despite of the methods name, it rewrite the complete XML file every time.

Protected Properties and Fields

Name

Description

ProjectFileExtension

The extension of the store's XML file.

ImageDirectory

The directory where images are copied to when saving.

Protected Methods

Name

Description

CalcImageDirectoryName

Calculates the full (absolute) path for the store's image directory.

DoOpen

Opens the XML file located at ProjectFilePath and reads the first part of the XML file containing the project settings and the project design. The rest of the XML file is loaded when calling any of the load methods.

LoadShapeConnections

If the XML file has not been loaded completely, it will be loaded. Otherwise, this method does nothing.

UnifyPath

Converts a windows path into an Uri (unified resource identifier) compliant path that can be used on both Windows and Linux.

Requirements

Namespace: Dataweb.NShape

Assembly: Dataweb.NShape