Click or drag to resize

ProjectFolder Class

Immutable class that holds a project folder name. Note that the root folder name is an empty string, and that all other folders have to end with an DirectorySeparatorChar. This rule also holds when splitting a full folder name into parts: the parts also have to end with a DirectorySeparatorChar or have to be the empty string.
Inheritance Hierarchy
SystemObject
  Altaxo.MainProjectFolder

Namespace: Altaxo.Main
Assembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax
C#
public class ProjectFolder : INamedObject

The ProjectFolder type exposes the following members.

Constructors
 NameDescription
Public methodProjectFolder Creates a project folder with the given name.
Top
Properties
 NameDescription
Public propertyIsRootFolderReturns true if the folder name is the root folder (empty string).
Public propertyNameGets the full folder name. The root folder is represented by an empty string. All other returned names end with an DirectorySeparatorChar.
Public propertyStatic memberRootFolder Returns the root folder instance.
Public propertyStatic memberRootFolderName Gets the string that is associated with the root folder (here: an empty string).
Top
Methods
 NameDescription
Public methodStatic memberAppendToName Appends a string to a full name (by appending to the name part only).
Public methodStatic memberAreAllNamesFromOneFolderDetermines whether all names in argument itemNames are from a single project folder.
Public methodStatic memberCombine Combines a folder name (with trailing DirectorySeparatorChar) with an item name, returning the full name of the item. If the trailing DirectorySeparatorChar is missed in the directoryPart, it is automatically appended to the directoryPart.
Public methodStatic memberConvertDisplayFolderNameToFolderName Converts a string that was used by the Gui or entered by the user (and contains no trailing DirectorySeparatorChar) to a valid folder name.
Public methodStatic memberConvertFolderNameToDisplayFolderLastPart Converts a folder name (i.e. either an empty string or a string with a trailing DirectorySeparatorChar) to a name which can be used to display. Only the last part of the folder name is returned here.
Public methodStatic memberConvertFolderNameToDisplayFolderName Converts a folder name (i.e. either an empty string or a string with a trailing DirectorySeparatorChar) to a name which can be used to display on the display.
Public methodStatic memberCreateFullName Creates a new name starting from a oldfullNameOrDir and a newName. Retrieves the directory information from the oldFullNameOrDir and combines it with the newName to form a new full name.
Public methodEquals
(Overrides ObjectEquals(Object))
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object)
Public methodStatic memberGetCommonFolderOfNames Gets the common folder of the provided item names.
Public methodStatic memberGetFolderPart Gets the directory part of a full qualified name. Can either be the name of an item (worksheet, graph) or a full folder name. If the name of a item is provided, the item's directory name is returned. If a full folder path is provided (i.e. either an empty string or a string ending with a DirectorySeparatorChar), the unchanged argument is returned.
Public methodStatic memberGetFolderPartWithoutTrailingDirectorySeparatorChar Intended for scripting purposes only! Gets the directory part of a full qualified name, but without the trailing DirectorySeparatorChar. No exception is thrown if the directory part is the root folder, thus the names '\Alice' and 'Alice' both return an empty string. The full qualified name can either be the name of an item (worksheet, graph) or a full folder name. If the name of a item is provided, the item's directory name (without trailing DirectorySeparatorChar) is returned. If a full folder path is provided (i.e. either an empty string or a string ending with a DirectorySeparatorChar), the name of the parent folder (without trailing DirectorySeparatorChar) is returned.
Public methodStatic memberCode exampleGetFoldersLastFolderPart Returns the name of the last folder from a folder path of arbitrary depth.
Public methodStatic memberGetFoldersParentFolder Gets the parent directory of the provided directory.
Public methodGetHashCode
(Overrides ObjectGetHashCode)
Public methodStatic memberGetNamePart Gets the name portion of a full name. Can either be the name of an item (worksheet, graph) or a full folder name. If the name of a item (worksheet or graph) is provided, the item's name without folder name is returned (thus containing no DirectorySeparatorChar)directory name is returned. If a full folder path is provided (i.e. either an empty string or a string ending with a DirectorySeparatorChar), the name of the last folder of the full folder path (!) is returned.
Public methodStatic memberGetRelativePathFromTo Gets the relative path from one folder to another folder.
Public methodGetTypeGets the Type of the current instance.
(Inherited from Object)
Public methodStatic memberIsRootFolderName Determines if the given string is the name of the root folder.
Public methodStatic memberIsValidFolderName 
Protected methodMemberwiseCloneCreates a shallow copy of the current Object.
(Inherited from Object)
Public methodStatic memberPrependToName Prepends a string to a full name (by prepending to the name part only).
Public methodStatic memberResolveRelativeDirectoryChars Resolves the relative directory chars (.) and (..).
Public methodStatic memberSplitFolderIntoParentFolderAndLastFolderPart Splits a full folder name name into the parent directory and the single directory name.
Public methodStatic memberSplitIntoFolderAndNamePart Splits into directory and name portion of a full name. The full name can either be the name of an item (worksheet, graph) or a full folder name. If the name of a item (worksheet or graph) is provided, it is splitted into the item's folder name and the item's name. If a full folder path is provided (i.e. either an empty string or a string ending with a DirectorySeparatorChar), it is splitted into the name of the parent folder and the name of the last folder.
Public methodStatic memberThrowExceptionOnInvalidFullFolderPath Test for the validity of a folder name of any level. The argument folderPath either has to be an empty string (representing the root folder) or a string ending with a directory separator char. If the argument is null, an ArgumentNullException is thrown. Otherwise, if the provided string is not a valid folder path, a ArgumentException will be thrown.
Public methodStatic memberThrowExceptionOnInvalidSingleFolderName Test for the validity of a single folder name. The folderName either has to be an empty string (representing the root folder) or a string ending with a directory separator char and containing no other directory separator chars. If the string is null, an ArgumentNullException is thrown. Otherwise, if the provided string is not a valid folder name, a ArgumentException will be thrown.
Public methodToString
(Overrides ObjectToString)
Public methodTryGetName Test if this item already has a name.
Top
Fields
 NameDescription
Public fieldStatic memberDirectorySeparatorCharChar used to separate project subfolders.
Public fieldStatic memberDirectorySeparatorStringChar used to separate project subfolders, here as a string for convenience..
Top
Extension Methods
 NameDescription
Public Extension MethodImportFilesIntoSeparateNewTables Imports multiple Ascii files into newly created new tables (each file into a separate table). The tables are named and stored in the project file in the provided project folder.
(Defined by AsciiImporter)
Public Extension MethodImportFilesIntoSeparateNewTables Imports multiple Ascii files into newly created new tables (each file into a separate table). The tables are named and stored in the project file in the provided project folder.
(Defined by AsciiImporter)
Public Extension MethodImportFilesIntoSeparateNewTables Imports multiple Ascii files into newly created new tables (each file into a separate table). The tables are named and stored in the project file in the provided project folder.
(Defined by AsciiImporter)
Top
See Also