Skip to content

PdfVisualOutlineItemAddEventArgs.AllowAdd Property

Gets or sets a value indicating whether the outline item should be added or not.

C#
public bool AllowAdd { get; set; }

Property Value

Boolean

True if the outline item should be added. Default is true.

Remarks

This property enables the application logic to decide when an outline item can be added to a PDF document.

Example

The code below shows how to ask for user confirmation before adding an outline item.

C#
1
2
3
4
private void documentOutlineView_BeforeOutlineItemAdd(object sender, PdfVisualOutlineItemAddEventArgs e)
{
    e.AllowAdd = MessageBox.Show($"Are you sure you want to add a new outline item?", "PDF Viewer Demo", MessageBoxButtons.YesNo) == DialogResult.Yes;
}