public void MakePreview(BBAddIn addIn) { addIn.bbColorSmells.decolorCells(transformationCells); if (addIn.theRibbon.dropDown1.Items.Count > 0) //if we have transformations available { FSharpTransformationRule T = AllTransformations.FirstOrDefault(x => x.Name == addIn.theRibbon.dropDown1.SelectedItem.Label); Excel.Range R = (addIn.Application.Selection); string formula = BBTransformations.RemoveFirstSymbol((string)R[1, 1].Formula); addIn.theRibbon.Preview.Text = T.ApplyOn(formula); addIn.theRibbon.valuePreview.Text = getValue((ExcelRaw.Range)R[1, 1].UnderlyingObject, addIn.theRibbon.Preview.Text); addIn.theRibbon.valuePreview.ShowImage = (addIn.theRibbon.valuePreview.Text != R[1, 1].Value.ToString()); if (R.Count == 1) { foreach (Excel.Worksheet worksheet in addIn.Application.Worksheets) { applyInRange(T, (ExcelRaw.Range)worksheet.UsedRange.UnderlyingObject, true); } } else { applyInRange(T, addIn.Application.Selection, true); } } }
public void clearTransformationsRibbon(BBAddIn addIn) { addIn.theRibbon.Preview.Text = ""; addIn.theRibbon.valuePreview.Text = ""; addIn.theRibbon.valuePreview.ShowImage = false; addIn.theRibbon.dropDown1.Items.Clear(); addIn.bbColorSmells.decolorCells(transformationCells); }
public BBMenuRefactorings(BBAddIn addIn) { this.addIn = addIn; }
public BBTransformations(BBAddIn addIn) { this.addIn = addIn; }
public BBColorSmells(BBAddIn addIn) { this.addIn = addIn; }