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, IConnectorLock

PictureFrameLock

Accessed via PictureFrame.PictureFrameLock. Controls editing restrictions on picture frames.

public class PictureFrameLock : BaseShapeLock, IPictureFrameLock

Properties

PropertyTypeAccessDescription
GroupingLockedboolReadPrevent grouping.
SelectLockedboolReadPrevent selection.
RotationLockedboolReadPrevent rotation.
AspectRatioLockedboolReadLock aspect ratio.
PositionLockedboolReadPrevent repositioning.
SizeLockedboolReadPrevent resizing.
EditPointsLockedboolReadPrevent editing geometry points.
AdjustHandlesLockedboolReadPrevent adjusting handles.
ArrowheadsLockedboolReadPrevent changing arrowheads.
ShapeTypeLockedboolReadPrevent changing shape type.
CropLockedboolReadPrevent cropping.
NoLocksboolReadWhether no locks are active.

GraphicalObjectLock

Accessed via Table.GraphicalObjectLock and other graphical objects.

public class GraphicalObjectLock : BaseShapeLock, IGraphicalObjectLock

Usage 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}");
    }
}

See Also