예제 #1
0
    /// <summary>
    /// Togles the 'DXP>Preferences>PCB Editor>General>Protect Locked Objects' setting.
    /// </summary>
    public void ToggleProtectLockedObjects()
    {
        try
        {
            IPCB_SystemOptions PCBSystemOptions;
            bool PLPSetting;
            PCBSystemOptions = PCBServer.GetState_SystemOptions();
            if (PCBSystemOptions == null)
            {
                return;
            }

            PLPSetting = PCBSystemOptions.GetState_ProtectLockedPrimitives();
            PLPSetting = !PLPSetting;
            PCBSystemOptions.SetState_ProtectLockedPrimitives(PLPSetting);
        }
        catch (Exception ex)
        {
            ErrorMail.LogError("Error in " + System.Reflection.MethodBase.GetCurrentMethod().Name + ".", ex);
        }
    }