public void updateSheetParams(AutomaticSourcingSheet sheet, object param) { int index = this.getAutomaticSourcingSheetIndex(sheet.position); if (index == -1) { return; } if (param is bool) { this.automaticSourcingSheetListChangeHandler.Items[index].firstRowColumn = (bool)param; } else if (param is string) { this.automaticSourcingSheetListChangeHandler.Items[index].selectedRange = param.ToString(); } else if (param is Kernel.Ui.Office.Range) { this.automaticSourcingSheetListChangeHandler.Items[index].selectedRange = ((Kernel.Ui.Office.Range)param).Name; this.automaticSourcingSheetListChangeHandler.Items[index].rangeSelected = ((Kernel.Ui.Office.Range)param); } else { this.automaticSourcingSheetListChangeHandler.Items[index].selectedRange = null; this.automaticSourcingSheetListChangeHandler.Items[index].rangeSelected = null; } if (sheet.toUpdate) { this.UpdateSheet(sheet); } if (sheet.toNew) { this.AddSheet(sheet); } if (sheet.toForget) { this.ForgetSheet(sheet); } if (sheet.toDelete) { this.RemoveSheet(sheet); } }
/// <summary> /// Oublier un Sheet /// </summary> /// <param name="cell"></param> public void ForgetSheet(AutomaticSourcingSheet sheet) { automaticSourcingSheetListChangeHandler.forget(sheet); OnPropertyChanged("automaticSourcingSheetListChangeHandler.Items"); }
/// <summary> /// Retire un Sheet /// </summary> /// <param name="cell"></param> public void RemoveSheet(AutomaticSourcingSheet sheet) { automaticSourcingSheetListChangeHandler.AddDeleted(sheet); OnPropertyChanged("automaticSourcingSheetListChangeHandler.Items"); }
/// <summary> /// Rajoute un Sheet /// </summary> /// <param name="cell"></param> public void AddSheet(AutomaticSourcingSheet sheet) { sheet.parent = this; automaticSourcingSheetListChangeHandler.AddNew(sheet); OnPropertyChanged("automaticSourcingSheetListChangeHandler.Items"); }