public WorkbookContext(Excel.Workbook workbook)
        {
            if (null == workbook)
            {
                throw new ArgumentNullException("workbook");
            }

            this.Workbook = workbook;
            this.Id       = GetContextId(workbook);

            if (string.IsNullOrWhiteSpace(this.Id))
            {
                this.Id = Guid.NewGuid().ToString();
                ExcelWorkbookCustomPropertyAccessor.Set(workbook, ID_PROPERTY, this.Id);
            }

            this.TestCases = new TestCaseCollection();
            this.settings  = WorkbookContextSettings.Load(this.Workbook);
            this.Update();
        }
 public static void Save(Excel.Workbook workbook, WorkbookContextSettings settings)
 {
     ExcelBookCustomXmlAcessor.SetCustomXml <WorkbookContextSettings>(workbook, NAMESPACE, settings);
 }
 public void SaveSettings()
 {
     WorkbookContextSettings.Save(this.Workbook, this.settings);
 }