Click or drag to resize

IFolder Interface

The representation of a folder that can contain objects (and other folders).

Namespace:  PDTec.IceNet.Core.Model
Assembly:  PDTec.IceNet.Core (in PDTec.IceNet.Core.dll) Version: 7.2.0.0 (7.2.7583.15464)
Syntax
C#
public interface IFolder

The IFolder type exposes the following members.

Properties
  NameDescription
Public propertyChangedBy
The ID of the user who changed the folder last.
Public propertyChangedOn
The point of time the folder was changed last.
Public propertyCreatedBy
The ID of the user who created the folder.
Public propertyCreatedOn
The point of time the folder was created.
Public propertyDescription
The folder description. The description can be empty.
Public propertyId
The folder ID. The ID is generated by the platform and cannot be modified.
Public propertyIsRootFolder
Gets the information whether this is the repository root folder or not.
Public propertyIsValid
Indicates if the folder instance is valid. The folder becomes invalid if the Destroy method has been called.
Public propertyName
The folder name. The name cannot be an empty string. It is modifiable and does not have to be unique.
Public propertyParentFolder
Gets the containing parent folder. Returns null if this is the root folder.
Top
Methods
  NameDescription
Public methodAddKey
Adds a new key to the folder. The key must be unique within the system context (e.g. unique per database).
Public methodCreateChild
Creates new child folder.
Public methodDeleteKey
Removes a key from the folder.
Public methodDestroy
Deletes the folder. Deletes all contained objects.
Public methodGetT(String, Boolean, Int32)
Retrieves all objects of a specific type contained in the folder up to a maximum number and returns them with a specific business object interface. This method fails if at least one of the objects specified by pObjType does not implement the T business object interface.
Public methodGetT(IObjType, Boolean, Int32)
Retrieves all objects of a specific type contained in the folder up to a maximum number and returns them with a specific business object interface. This method fails if at least one of the objects specified by pObjType does not implement the T business object interface.
Public methodGetChildFolders
Retrieves the child folders.
Public methodGetKeys
Retrieves the folder's (unique) keys.
Public methodGetObjects
Retrieves all objects contained in the folder.
Public methodGetObjects(Int32)
Retrieves all objects contained in the folder up to a maximum number.
Public methodGetObjects(String, Boolean, Int32)
Retrieves all objects of a specific type contained in the folder up to a maximum number.
Public methodGetObjects(IObjType, Boolean, Int32)
Retrieves all objects of a specific type contained in the folder up to a maximum number.
Public methodGetObjectsCount
Retrieves the number of objects contained in the folder.
Public methodGetParentFolder
Retrieves the parent folder (if this is not the root folder).
Public methodMoveTo
Moves the folder to another folder.
Public methodReload
Refreshes the folder data from secondary storage (e.g. database) if available. Use this method to retrieve up-to-date audit information (ChangedBy, ChangedOn properties).
Public methodSetChildFolderIndex
Sets the sequence index of the child folder.
Public methodSetChildFolderIndices
Reorders the child folders sequence.
Public methodTouch
Updates the ChangedBy and ChangedOn information.
Top
Examples

This example shows how to use the CreateChild(String, String) method to create folders.

C#
Repository.ExecuteTransaction(delegate()
{
    IFolder pDataFolder = Repository.RootFolder.CreateChild("Data", "");
    IFolder pCarsFolder = pDataFolder.CreateChild("Cars", "");
});
Examples

This example shows how to retrieve child folders and objects. The GetObjects(IObjType, Boolean, Int32) method allows to filter by object type and to restrict the number of results.

C#
foreach (IFolder pFolder in Repository.RootFolder.GetChildFolders())
{
    Console.WriteLine("Folder " + pFolder.Name);

    IObject[] aAllObjects = pFolder.GetObjects();

    Console.WriteLine("    Objects: " + aAllObjects.Length);

    IObject[] aVehicles = pFolder.GetObjects(Repository.GetObjTypeByName("PDTec.ICR.Vehicle"), false, 0);

    Console.WriteLine("    Vehicles: " + aVehicles.Length);
}
See Also