Protection — Aspose.Slides FOSS for .NET API Reference
Protection in Aspose.Slides FOSS for .NET is managed through shape lock classes that control which editing operations are restricted on individual shapes.
Package: Aspose.Slides.Foss (net9.0)
using Aspose.Slides.Foss;ConnectorLock
Accessed via Connector.ConnectorLock. Controls editing restrictions on connector shapes.
public class ConnectorLock : BaseShapeLock, IConnectorLockPictureFrameLock
Accessed via PictureFrame.PictureFrameLock. Controls editing restrictions on picture frames.
public class PictureFrameLock : BaseShapeLock, IPictureFrameLockProperties
| Property | Type | Access | Description |
|---|---|---|---|
GroupingLocked | bool | Read | Prevent grouping. |
SelectLocked | bool | Read | Prevent selection. |
RotationLocked | bool | Read | Prevent rotation. |
AspectRatioLocked | bool | Read | Lock aspect ratio. |
PositionLocked | bool | Read | Prevent repositioning. |
SizeLocked | bool | Read | Prevent resizing. |
EditPointsLocked | bool | Read | Prevent editing geometry points. |
AdjustHandlesLocked | bool | Read | Prevent adjusting handles. |
ArrowheadsLocked | bool | Read | Prevent changing arrowheads. |
ShapeTypeLocked | bool | Read | Prevent changing shape type. |
CropLocked | bool | Read | Prevent cropping. |
NoLocks | bool | Read | Whether no locks are active. |
GraphicalObjectLock
Accessed via Table.GraphicalObjectLock and other graphical objects.
public class GraphicalObjectLock : BaseShapeLock, IGraphicalObjectLockUsage Examples
Check Shape Locks
using Aspose.Slides.Foss;
using var prs = new Presentation("deck.pptx");
foreach (var shape in prs.Slides[0].Shapes)
{
if (shape is IPictureFrame pf && pf.PictureFrameLock != null)
{
Console.WriteLine($"'{shape.Name}' aspect locked: {pf.PictureFrameLock.AspectRatioLocked}");
}
}