ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / StyleProjectItem Class / IsReadOnly Property
Example

In This Topic
    IsReadOnly Property (StyleProjectItem)
    In This Topic
    Gets the value which indicates if the StyleProjectItem is read-only.
    Syntax
    Public ReadOnly Property IsReadOnly As Boolean
    public bool IsReadOnly {get;}
    Remarks
    Note that the style file cannot be modified if it is not current, even if it is not read-only.
    Example
    How to determine if a style is read-only
    {
        //Add the style to the current project
        string stylePath = @"C:\MyStyles\MyStyle.stylx";
        //Note: Needs QueuedTask to run
        StyleHelper.AddStyle(Project.Current, stylePath);
        StyleProjectItem styleToCheck = Project.Current.GetItems<StyleProjectItem>().First(x => x.Path == stylePath);
        //returns true if style is read-only
        bool isReadOnly = styleToCheck.IsReadOnly;
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also