[]
如果插件中引用了页面中的单元格,一旦被引用的单元格的位置发生了变化,如拖拽,那么插件中的相关单元格引用也应该被同步;
这种情况下就需要实现这个接口,而且,当查找页面中的单元格引用时,插件中的相关属性也会被查找出来。
public interface IReferenceFormula
public class MyCellType : CellType, IReferenceFormula
{
[FormulaProperty]
public object ReferCell { get; set; }
public IEnumerable<LocatedObject<object>> GetFormulaReferObjects(LocationIndicator location)
{
var newLocation = location.AppendProperty("MyCellType").AppendProperty("ReferCell");
yield return new LocatedObject<object>(this.ReferCell, newLocation);
}
}
获取插件中所有引用单元格或单元格区域的公式对象。
IEnumerable<LocatedObject<object>> GetFormulaReferObjects(LocationIndicator location)
类型 | 名称 | 描述 |
---|---|---|
LocationIndicator | location | 坐标定位器。 |
类型 | 描述 |
---|---|
System.Collections.Generic.IEnumerable<T><LocatedObject<object>> | 返回所有引用单元格或单元格区域的公式对象。 |