public static void Run()
{
// ExStart:VisioDiagramProtection
// The path to the documents directory.
string dataDir = RunExamples.GetDataDir_Protection();
// Load diagram
Diagram diagram = new Diagram(dataDir + "ProtectAndUnprotect.vsd");
diagram.DocumentSettings.ProtectBkgnds = BOOL.True;
diagram.DocumentSettings.ProtectMasters = BOOL.True;
diagram.DocumentSettings.ProtectShapes = BOOL.True;
diagram.DocumentSettings.ProtectStyles = BOOL.True;
// Save diagram
diagram.Save(dataDir + "VisioDiagramProtection_out.vdx", SaveFileFormat.VDX);
// ExEnd:VisioDiagramProtection
}
}