AbsoluteDocumentPathReplacePathParts Method |
Replaces parts of the part by another part.
Namespace: Altaxo.MainAssembly: AltaxoBase (in AltaxoBase.dll) Version: 4.8.3179.0 (4.8.3179.0)
Syntax public bool ReplacePathParts(
AbsoluteDocumentPath partToReplace,
AbsoluteDocumentPath newPart,
out AbsoluteDocumentPath newPath
)
Parameters
- partToReplace AbsoluteDocumentPath
- Part of the path that should be replaced. This part has to match the beginning of this part. The last item of the part
is allowed to be given only partially.
- newPart AbsoluteDocumentPath
- The new part to replace that piece of the path, that match the partToReplace.
- newPath AbsoluteDocumentPath
- The resulting new path (if the return value is true), or the original path, if the return value is false.
Return Value
BooleanTrue if the part could be replaced. Returns false if the path does not fulfill the presumtions given above.
Remarks
As stated above, the last item of the partToReplace can be given only partially. As an example, the path (here separated by space)
Tables Preexperiment1/WDaten Time
should be replaced by
Tables Preexperiment2\WDaten Time
To make this replacement, the partToReplace should be given by
Tables Preexperiment1/
and the newPart should be given by
Tables Preexperiment2\
Note that Preexperiment1\ and Preexperiment2\ are only partially defined items of the path.
See Also