Smrf.NodeXL.ExcelTemplate.GroupManager.GetGroupCommandsToEnable C# (CSharp) Method

GetGroupCommandsToEnable() public static method

public static GetGroupCommandsToEnable ( Microsoft workbook ) : GroupCommands
workbook Microsoft
return GroupCommands
    GetGroupCommandsToEnable
    (
        Microsoft.Office.Interop.Excel.Workbook workbook
    )
    {
        // Various worksheets must be activated to read their selection.  Save
        // the active worksheet state.

        ExcelActiveWorksheetRestorer oExcelActiveWorksheetRestorer =
            new ExcelActiveWorksheetRestorer(workbook);

        ExcelActiveWorksheetState oExcelActiveWorksheetState =
            oExcelActiveWorksheetRestorer.GetActiveWorksheetState();

        GroupCommands eGroupCommandsToEnable;

        try
        {
            eGroupCommandsToEnable =
                GetGroupCommandsToEnableInternal(workbook);
        }
        finally
        {
            oExcelActiveWorksheetRestorer.Restore(oExcelActiveWorksheetState);
        }

        return (eGroupCommandsToEnable);
    }